apis
Creates, updates, deletes, gets or lists an apis
resource.
Overview
Name | apis |
Type | Resource |
Id | google.apihub.apis |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The name of the API resource in the API Hub. Format: projects/{project}/locations/{location}/apis/{api} |
apiFunctionalRequirements | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
apiRequirements | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
apiStyle | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
apiTechnicalRequirements | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
attributes | object | Optional. The list of user defined attributes associated with the API resource. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute} . The value is the attribute values associated with the resource. |
businessUnit | object | Optional. The business unit owning the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-business-unit attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute. (id: GoogleCloudApihubV1AttributeValues) |
createTime | string (google-datetime) | Output only. The time at which the API resource was created. |
description | string | Optional. The description of the API resource. |
displayName | string | Required. The display name of the API resource. |
documentation | object | Optional. The documentation for the API resource. (id: GoogleCloudApihubV1Documentation) |
fingerprint | string | Optional. Fingerprint of the API resource. |
maturityLevel | object | Optional. The maturity level of the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-maturity-level attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute. (id: GoogleCloudApihubV1AttributeValues) |
owner | object | Optional. Owner details for the API resource. (id: GoogleCloudApihubV1Owner) |
selectedVersion | string | Optional. The selected version for an API resource. This can be used when special handling is needed on client side for particular version of the API. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version} |
sourceMetadata | array | Output only. The list of sources and metadata from the sources of the API resource. |
targetUser | object | Optional. The target users for the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-target-user attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute. (id: GoogleCloudApihubV1AttributeValues) |
team | object | Optional. The team owning the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-team attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute. (id: GoogleCloudApihubV1AttributeValues) |
updateTime | string (google-datetime) | Output only. The time at which the API resource was last updated. |
versions | array | Output only. The list of versions present in an API resource. Note: An API resource can be associated with more than 1 version. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version} |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The name of the API resource in the API Hub. Format: projects/{project}/locations/{location}/apis/{api} |
apiFunctionalRequirements | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
apiRequirements | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
apiStyle | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
apiTechnicalRequirements | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
attributes | object | Optional. The list of user defined attributes associated with the API resource. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute} . The value is the attribute values associated with the resource. |
businessUnit | object | Optional. The business unit owning the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-business-unit attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute. (id: GoogleCloudApihubV1AttributeValues) |
createTime | string (google-datetime) | Output only. The time at which the API resource was created. |
description | string | Optional. The description of the API resource. |
displayName | string | Required. The display name of the API resource. |
documentation | object | Optional. The documentation for the API resource. (id: GoogleCloudApihubV1Documentation) |
fingerprint | string | Optional. Fingerprint of the API resource. |
maturityLevel | object | Optional. The maturity level of the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-maturity-level attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute. (id: GoogleCloudApihubV1AttributeValues) |
owner | object | Optional. Owner details for the API resource. (id: GoogleCloudApihubV1Owner) |
selectedVersion | string | Optional. The selected version for an API resource. This can be used when special handling is needed on client side for particular version of the API. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version} |
sourceMetadata | array | Output only. The list of sources and metadata from the sources of the API resource. |
targetUser | object | Optional. The target users for the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-target-user attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute. (id: GoogleCloudApihubV1AttributeValues) |
team | object | Optional. The team owning the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-team attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute. (id: GoogleCloudApihubV1AttributeValues) |
updateTime | string (google-datetime) | Output only. The time at which the API resource was last updated. |
versions | array | Output only. The list of versions present in an API resource. Note: An API resource can be associated with more than 1 version. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version} |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , apisId | Get API resource details including the API versions contained in it. | |
list | select | projectsId , locationsId | filter , pageSize , pageToken | List API resources in the API hub. |
create | insert | projectsId , locationsId | apiId | Create an API resource in the API hub. Once an API resource is created, versions can be added to it. |
patch | update | projectsId , locationsId , apisId | updateMask | Update an API resource in the API hub. The following fields in the API can be updated: * display_name * description * owner * documentation * target_user * team * business_unit * maturity_level * api_style * attributes The update_mask should be used to specify the fields being updated. Updating the owner field requires complete owner message and updates both owner and email fields. |
delete | delete | projectsId , locationsId , apisId | force | Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
apisId | string | |
locationsId | string | |
projectsId | string | |
apiId | string | |
filter | string | |
force | boolean | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Get API resource details including the API versions contained in it.
SELECT
name,
apiFunctionalRequirements,
apiRequirements,
apiStyle,
apiTechnicalRequirements,
attributes,
businessUnit,
createTime,
description,
displayName,
documentation,
fingerprint,
maturityLevel,
owner,
selectedVersion,
sourceMetadata,
targetUser,
team,
updateTime,
versions
FROM google.apihub.apis
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required;
List API resources in the API hub.
SELECT
name,
apiFunctionalRequirements,
apiRequirements,
apiStyle,
apiTechnicalRequirements,
attributes,
businessUnit,
createTime,
description,
displayName,
documentation,
fingerprint,
maturityLevel,
owner,
selectedVersion,
sourceMetadata,
targetUser,
team,
updateTime,
versions
FROM google.apihub.apis
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Create an API resource in the API hub. Once an API resource is created, versions can be added to it.
INSERT INTO google.apihub.apis (
data__name,
data__displayName,
data__description,
data__documentation,
data__owner,
data__targetUser,
data__team,
data__businessUnit,
data__maturityLevel,
data__attributes,
data__apiStyle,
data__selectedVersion,
data__apiRequirements,
data__fingerprint,
data__apiFunctionalRequirements,
data__apiTechnicalRequirements,
projectsId,
locationsId,
apiId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ documentation }}',
'{{ owner }}',
'{{ targetUser }}',
'{{ team }}',
'{{ businessUnit }}',
'{{ maturityLevel }}',
'{{ attributes }}',
'{{ apiStyle }}',
'{{ selectedVersion }}',
'{{ apiRequirements }}',
'{{ fingerprint }}',
'{{ apiFunctionalRequirements }}',
'{{ apiTechnicalRequirements }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ apiId }}'
RETURNING
name,
apiFunctionalRequirements,
apiRequirements,
apiStyle,
apiTechnicalRequirements,
attributes,
businessUnit,
createTime,
description,
displayName,
documentation,
fingerprint,
maturityLevel,
owner,
selectedVersion,
sourceMetadata,
targetUser,
team,
updateTime,
versions
;
# Description fields are for documentation purposes
- name: apis
props:
- name: projectsId
value: string
description: Required parameter for the apis resource.
- name: locationsId
value: string
description: Required parameter for the apis resource.
- name: name
value: string
description: >
Identifier. The name of the API resource in the API Hub. Format: `projects/{project}/locations/{location}/apis/{api}`
- name: displayName
value: string
description: >
Required. The display name of the API resource.
- name: description
value: string
description: >
Optional. The description of the API resource.
- name: documentation
value: object
description: >
Optional. The documentation for the API resource.
- name: owner
value: object
description: >
Optional. Owner details for the API resource.
- name: targetUser
value: object
description: >
Optional. The target users for the API. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-target-user` attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute.
- name: team
value: object
description: >
Optional. The team owning the API. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-team` attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute.
- name: businessUnit
value: object
description: >
Optional. The business unit owning the API. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-business-unit` attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute.
- name: maturityLevel
value: object
description: >
Optional. The maturity level of the API. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-maturity-level` attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. All values should be from the list of allowed values defined for the attribute.
- name: attributes
value: object
description: >
Optional. The list of user defined attributes associated with the API resource. The key is the attribute name. It will be of the format: `projects/{project}/locations/{location}/attributes/{attribute}`. The value is the attribute values associated with the resource.
- name: apiStyle
value: object
description: >
The attribute values associated with resource.
- name: selectedVersion
value: string
description: >
Optional. The selected version for an API resource. This can be used when special handling is needed on client side for particular version of the API. Format is `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
- name: apiRequirements
value: object
description: >
The attribute values associated with resource.
- name: fingerprint
value: string
description: >
Optional. Fingerprint of the API resource.
- name: apiFunctionalRequirements
value: object
description: >
The attribute values associated with resource.
- name: apiTechnicalRequirements
value: object
description: >
The attribute values associated with resource.
- name: apiId
value: string
UPDATE
examples
- patch
Update an API resource in the API hub. The following fields in the API can be updated: * display_name * description * owner * documentation * target_user * team * business_unit * maturity_level * api_style * attributes The update_mask should be used to specify the fields being updated. Updating the owner field requires complete owner message and updates both owner and email fields.
UPDATE google.apihub.apis
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__documentation = '{{ documentation }}',
data__owner = '{{ owner }}',
data__targetUser = '{{ targetUser }}',
data__team = '{{ team }}',
data__businessUnit = '{{ businessUnit }}',
data__maturityLevel = '{{ maturityLevel }}',
data__attributes = '{{ attributes }}',
data__apiStyle = '{{ apiStyle }}',
data__selectedVersion = '{{ selectedVersion }}',
data__apiRequirements = '{{ apiRequirements }}',
data__fingerprint = '{{ fingerprint }}',
data__apiFunctionalRequirements = '{{ apiFunctionalRequirements }}',
data__apiTechnicalRequirements = '{{ apiTechnicalRequirements }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
apiFunctionalRequirements,
apiRequirements,
apiStyle,
apiTechnicalRequirements,
attributes,
businessUnit,
createTime,
description,
displayName,
documentation,
fingerprint,
maturityLevel,
owner,
selectedVersion,
sourceMetadata,
targetUser,
team,
updateTime,
versions;
DELETE
examples
- delete
Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.
DELETE FROM google.apihub.apis
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND force = '{{ force }}';