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
| 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 | Optional. The api functional requirements associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-api-functional-requirements attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory. (id: GoogleCloudApihubV1AttributeValues) |
apiRequirements | object | Optional. The api requirement doc associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-api-requirements attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory. (id: GoogleCloudApihubV1AttributeValues) |
apiStyle | object | Optional. The style of the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-api-style 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) |
apiTechnicalRequirements | object | Optional. The api technical requirements associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-api-technical-requirements attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory. (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 | The attribute values associated with resource. (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. This must be unique for each API resource. It can neither be unset nor be updated to an existing fingerprint of another API resource. |
maturityLevel | object | The attribute values associated with resource. (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 | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
team | object | The attribute values associated with resource. (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} |
| 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 | Optional. The api functional requirements associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-api-functional-requirements attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory. (id: GoogleCloudApihubV1AttributeValues) |
apiRequirements | object | Optional. The api requirement doc associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-api-requirements attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory. (id: GoogleCloudApihubV1AttributeValues) |
apiStyle | object | Optional. The style of the API. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-api-style 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) |
apiTechnicalRequirements | object | Optional. The api technical requirements associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-api-technical-requirements attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory. (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 | The attribute values associated with resource. (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. This must be unique for each API resource. It can neither be unset nor be updated to an existing fingerprint of another API resource. |
maturityLevel | object | The attribute values associated with resource. (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 | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
team | object | The attribute values associated with resource. (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 * fingerprint 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__apiFunctionalRequirements,
data__apiRequirements,
data__apiStyle,
data__apiTechnicalRequirements,
data__attributes,
data__businessUnit,
data__description,
data__displayName,
data__documentation,
data__fingerprint,
data__maturityLevel,
data__name,
data__owner,
data__selectedVersion,
data__targetUser,
data__team,
projectsId,
locationsId,
apiId
)
SELECT
'{{ apiFunctionalRequirements }}',
'{{ apiRequirements }}',
'{{ apiStyle }}',
'{{ apiTechnicalRequirements }}',
'{{ attributes }}',
'{{ businessUnit }}',
'{{ description }}',
'{{ displayName }}',
'{{ documentation }}',
'{{ fingerprint }}',
'{{ maturityLevel }}',
'{{ name }}',
'{{ owner }}',
'{{ selectedVersion }}',
'{{ targetUser }}',
'{{ team }}',
'{{ 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: "{{ projectsId }}"
description: Required parameter for the apis resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the apis resource.
- name: apiFunctionalRequirements
description: |
Optional. The api functional requirements associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-api-functional-requirements` attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
displayName: "{{ displayName }}"
id: "{{ id }}"
immutable: {{ immutable }}
jsonValues:
values:
- "{{ values }}"
stringValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: apiRequirements
description: |
Optional. The api requirement doc associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-api-requirements` attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
displayName: "{{ displayName }}"
id: "{{ id }}"
immutable: {{ immutable }}
jsonValues:
values:
- "{{ values }}"
stringValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: apiStyle
description: |
Optional. The style of the API. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-api-style` 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.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
displayName: "{{ displayName }}"
id: "{{ id }}"
immutable: {{ immutable }}
jsonValues:
values:
- "{{ values }}"
stringValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: apiTechnicalRequirements
description: |
Optional. The api technical requirements associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-api-technical-requirements` attribute. The value of the attribute should be a proper URI, and in case of Cloud Storage URI, it should point to a Cloud Storage object, not a directory.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
displayName: "{{ displayName }}"
id: "{{ id }}"
immutable: {{ immutable }}
jsonValues:
values:
- "{{ values }}"
stringValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: attributes
value: "{{ attributes }}"
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: businessUnit
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
displayName: "{{ displayName }}"
id: "{{ id }}"
immutable: {{ immutable }}
jsonValues:
values:
- "{{ values }}"
stringValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: description
value: "{{ description }}"
description: |
Optional. The description of the API resource.
- name: displayName
value: "{{ displayName }}"
description: |
Required. The display name of the API resource.
- name: documentation
description: |
Optional. The documentation for the API resource.
value:
externalUri: "{{ externalUri }}"
- name: fingerprint
value: "{{ fingerprint }}"
description: |
Optional. Fingerprint of the API resource. This must be unique for each API resource. It can neither be unset nor be updated to an existing fingerprint of another API resource.
- name: maturityLevel
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
displayName: "{{ displayName }}"
id: "{{ id }}"
immutable: {{ immutable }}
jsonValues:
values:
- "{{ values }}"
stringValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: name
value: "{{ name }}"
description: |
Identifier. The name of the API resource in the API Hub. Format: `projects/{project}/locations/{location}/apis/{api}`
- name: owner
description: |
Optional. Owner details for the API resource.
value:
displayName: "{{ displayName }}"
email: "{{ email }}"
- name: selectedVersion
value: "{{ selectedVersion }}"
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: targetUser
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
displayName: "{{ displayName }}"
id: "{{ id }}"
immutable: {{ immutable }}
jsonValues:
values:
- "{{ values }}"
stringValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: team
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
displayName: "{{ displayName }}"
id: "{{ id }}"
immutable: {{ immutable }}
jsonValues:
values:
- "{{ values }}"
stringValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: apiId
value: "{{ apiId }}"
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 * fingerprint 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__apiFunctionalRequirements = '{{ apiFunctionalRequirements }}',
data__apiRequirements = '{{ apiRequirements }}',
data__apiStyle = '{{ apiStyle }}',
data__apiTechnicalRequirements = '{{ apiTechnicalRequirements }}',
data__attributes = '{{ attributes }}',
data__businessUnit = '{{ businessUnit }}',
data__description = '{{ description }}',
data__displayName = '{{ displayName }}',
data__documentation = '{{ documentation }}',
data__fingerprint = '{{ fingerprint }}',
data__maturityLevel = '{{ maturityLevel }}',
data__name = '{{ name }}',
data__owner = '{{ owner }}',
data__selectedVersion = '{{ selectedVersion }}',
data__targetUser = '{{ targetUser }}',
data__team = '{{ team }}'
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 }}'
;