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 | 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 | 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 | 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 | 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 | pageToken, filter, pageSize | 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 pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
;
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__description,
data__owner,
data__apiRequirements,
data__documentation,
data__selectedVersion,
data__displayName,
data__team,
data__maturityLevel,
data__fingerprint,
data__apiFunctionalRequirements,
data__attributes,
data__apiStyle,
data__businessUnit,
data__targetUser,
data__apiTechnicalRequirements,
projectsId,
locationsId,
apiId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ owner }}',
'{{ apiRequirements }}',
'{{ documentation }}',
'{{ selectedVersion }}',
'{{ displayName }}',
'{{ team }}',
'{{ maturityLevel }}',
'{{ fingerprint }}',
'{{ apiFunctionalRequirements }}',
'{{ attributes }}',
'{{ apiStyle }}',
'{{ businessUnit }}',
'{{ targetUser }}',
'{{ 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: "{{ projectsId }}"
description: Required parameter for the apis resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the apis resource.
- name: name
value: "{{ name }}"
description: |
Identifier. The name of the API resource in the API Hub. Format: `projects/{project}/locations/{location}/apis/{api}`
- name: description
value: "{{ description }}"
description: |
Optional. The description of the API resource.
- name: owner
description: |
Optional. Owner details for the API resource.
value:
email: "{{ email }}"
displayName: "{{ displayName }}"
- name: apiRequirements
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: documentation
description: |
Optional. The documentation for the API resource.
value:
externalUri: "{{ externalUri }}"
- 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: displayName
value: "{{ displayName }}"
description: |
Required. The display name of the API resource.
- name: team
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: maturityLevel
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- 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: apiFunctionalRequirements
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
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: apiStyle
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: businessUnit
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: targetUser
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
values:
- "{{ values }}"
uriValues:
values:
- "{{ values }}"
- name: apiTechnicalRequirements
description: |
The attribute values associated with resource.
value:
attribute: "{{ attribute }}"
enumValues:
values:
- description: "{{ description }}"
id: "{{ id }}"
displayName: "{{ displayName }}"
immutable: {{ immutable }}
stringValues:
values:
- "{{ values }}"
jsonValues:
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__name = '{{ name }}',
data__description = '{{ description }}',
data__owner = '{{ owner }}',
data__apiRequirements = '{{ apiRequirements }}',
data__documentation = '{{ documentation }}',
data__selectedVersion = '{{ selectedVersion }}',
data__displayName = '{{ displayName }}',
data__team = '{{ team }}',
data__maturityLevel = '{{ maturityLevel }}',
data__fingerprint = '{{ fingerprint }}',
data__apiFunctionalRequirements = '{{ apiFunctionalRequirements }}',
data__attributes = '{{ attributes }}',
data__apiStyle = '{{ apiStyle }}',
data__businessUnit = '{{ businessUnit }}',
data__targetUser = '{{ targetUser }}',
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 }}'
;