versions
Creates, updates, deletes, gets or lists a versions resource.
Overview
| Name | versions |
| Type | Resource |
| Id | google.apihub.versions |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The name of the version. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version} |
accreditation | object | Optional. The accreditations associated with the API version. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-accreditation 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) |
apiOperations | array | Output only. The operations contained in the API version. These operations will be added to the version when a new spec is added or when an existing spec is updated. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation} |
attributes | object | Optional. The list of user defined attributes associated with the Version 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. |
compliance | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
createTime | string (google-datetime) | Output only. The time at which the version was created. |
definitions | array | Output only. The definitions contained in the API version. These definitions will be added to the version when a new spec is added or when an existing spec is updated. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition} |
deployments | array | Optional. The deployments linked to this API version. Note: A particular API version could be deployed to multiple deployments (for dev deployment, UAT deployment, etc) Format is projects/{project}/locations/{location}/deployments/{deployment} |
description | string | Optional. The description of the version. |
displayName | string | Required. The display name of the version. |
documentation | object | Optional. The documentation of the version. (id: GoogleCloudApihubV1Documentation) |
lifecycle | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
selectedDeployment | string | Optional. The selected deployment for a Version resource. This can be used when special handling is needed on client side for a particular deployment linked to the version. Format is projects/{project}/locations/{location}/deployments/{deployment} |
sourceMetadata | array | Output only. The list of sources and metadata from the sources of the version. |
specs | array | Output only. The specs associated with this version. Note that an API version can be associated with multiple specs. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec} |
updateTime | string (google-datetime) | Output only. The time at which the version was last updated. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The name of the version. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version} |
accreditation | object | Optional. The accreditations associated with the API version. This maps to the following system defined attribute: projects/{project}/locations/{location}/attributes/system-accreditation 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) |
apiOperations | array | Output only. The operations contained in the API version. These operations will be added to the version when a new spec is added or when an existing spec is updated. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation} |
attributes | object | Optional. The list of user defined attributes associated with the Version 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. |
compliance | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
createTime | string (google-datetime) | Output only. The time at which the version was created. |
definitions | array | Output only. The definitions contained in the API version. These definitions will be added to the version when a new spec is added or when an existing spec is updated. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition} |
deployments | array | Optional. The deployments linked to this API version. Note: A particular API version could be deployed to multiple deployments (for dev deployment, UAT deployment, etc) Format is projects/{project}/locations/{location}/deployments/{deployment} |
description | string | Optional. The description of the version. |
displayName | string | Required. The display name of the version. |
documentation | object | Optional. The documentation of the version. (id: GoogleCloudApihubV1Documentation) |
lifecycle | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
selectedDeployment | string | Optional. The selected deployment for a Version resource. This can be used when special handling is needed on client side for a particular deployment linked to the version. Format is projects/{project}/locations/{location}/deployments/{deployment} |
sourceMetadata | array | Output only. The list of sources and metadata from the sources of the version. |
specs | array | Output only. The specs associated with this version. Note that an API version can be associated with multiple specs. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec} |
updateTime | string (google-datetime) | Output only. The time at which the version was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, apisId, versionsId | Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it. | |
list | select | projectsId, locationsId, apisId | pageToken, filter, pageSize | List API versions of an API resource in the API hub. |
create | insert | projectsId, locationsId, apisId | versionId | Create an API version for an API resource in the API hub. |
patch | update | projectsId, locationsId, apisId, versionsId | updateMask | Update API version. The following fields in the version can be updated currently: * display_name * description * documentation * deployments * lifecycle * compliance * accreditation * attributes The update_mask should be used to specify the fields being updated. |
delete | delete | projectsId, locationsId, apisId, versionsId | force | Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments 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 | |
versionsId | string | |
filter | string | |
force | boolean | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) | |
versionId | string |
SELECT examples
- get
- list
Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.
SELECT
name,
accreditation,
apiOperations,
attributes,
compliance,
createTime,
definitions,
deployments,
description,
displayName,
documentation,
lifecycle,
selectedDeployment,
sourceMetadata,
specs,
updateTime
FROM google.apihub.versions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required
AND versionsId = '{{ versionsId }}' -- required
;
List API versions of an API resource in the API hub.
SELECT
name,
accreditation,
apiOperations,
attributes,
compliance,
createTime,
definitions,
deployments,
description,
displayName,
documentation,
lifecycle,
selectedDeployment,
sourceMetadata,
specs,
updateTime
FROM google.apihub.versions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
;
INSERT examples
- create
- Manifest
Create an API version for an API resource in the API hub.
INSERT INTO google.apihub.versions (
data__displayName,
data__accreditation,
data__attributes,
data__name,
data__description,
data__lifecycle,
data__documentation,
data__deployments,
data__selectedDeployment,
data__compliance,
projectsId,
locationsId,
apisId,
versionId
)
SELECT
'{{ displayName }}',
'{{ accreditation }}',
'{{ attributes }}',
'{{ name }}',
'{{ description }}',
'{{ lifecycle }}',
'{{ documentation }}',
'{{ deployments }}',
'{{ selectedDeployment }}',
'{{ compliance }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ apisId }}',
'{{ versionId }}'
RETURNING
name,
accreditation,
apiOperations,
attributes,
compliance,
createTime,
definitions,
deployments,
description,
displayName,
documentation,
lifecycle,
selectedDeployment,
sourceMetadata,
specs,
updateTime
;
# Description fields are for documentation purposes
- name: versions
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the versions resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the versions resource.
- name: apisId
value: "{{ apisId }}"
description: Required parameter for the versions resource.
- name: displayName
value: "{{ displayName }}"
description: |
Required. The display name of the version.
- name: accreditation
description: |
Optional. The accreditations associated with the API version. This maps to the following system defined attribute: `projects/{project}/locations/{location}/attributes/system-accreditation` 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 }}"
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 Version 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: name
value: "{{ name }}"
description: |
Identifier. The name of the version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
- name: description
value: "{{ description }}"
description: |
Optional. The description of the version.
- name: lifecycle
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 of the version.
value:
externalUri: "{{ externalUri }}"
- name: deployments
value:
- "{{ deployments }}"
description: |
Optional. The deployments linked to this API version. Note: A particular API version could be deployed to multiple deployments (for dev deployment, UAT deployment, etc) Format is `projects/{project}/locations/{location}/deployments/{deployment}`
- name: selectedDeployment
value: "{{ selectedDeployment }}"
description: |
Optional. The selected deployment for a Version resource. This can be used when special handling is needed on client side for a particular deployment linked to the version. Format is `projects/{project}/locations/{location}/deployments/{deployment}`
- name: compliance
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: versionId
value: "{{ versionId }}"
UPDATE examples
- patch
Update API version. The following fields in the version can be updated currently: * display_name * description * documentation * deployments * lifecycle * compliance * accreditation * attributes The update_mask should be used to specify the fields being updated.
UPDATE google.apihub.versions
SET
data__displayName = '{{ displayName }}',
data__accreditation = '{{ accreditation }}',
data__attributes = '{{ attributes }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__lifecycle = '{{ lifecycle }}',
data__documentation = '{{ documentation }}',
data__deployments = '{{ deployments }}',
data__selectedDeployment = '{{ selectedDeployment }}',
data__compliance = '{{ compliance }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
accreditation,
apiOperations,
attributes,
compliance,
createTime,
definitions,
deployments,
description,
displayName,
documentation,
lifecycle,
selectedDeployment,
sourceMetadata,
specs,
updateTime;
DELETE examples
- delete
Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.
DELETE FROM google.apihub.versions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND force = '{{ force }}'
;