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 | The attribute values associated with resource. (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 directly to this API version. Only directly-linked deployments are returned; deployments linked to this version's specs or operations are not included. 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 | The attribute values associated with resource. (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 directly to this API version. Only directly-linked deployments are returned; deployments linked to this version's specs or operations are not included. 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 | filter, pageSize, pageToken | 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 filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- create
- Manifest
Create an API version for an API resource in the API hub.
INSERT INTO google.apihub.versions (
data__accreditation,
data__attributes,
data__compliance,
data__deployments,
data__description,
data__displayName,
data__documentation,
data__lifecycle,
data__name,
data__selectedDeployment,
projectsId,
locationsId,
apisId,
versionId
)
SELECT
'{{ accreditation }}',
'{{ attributes }}',
'{{ compliance }}',
'{{ deployments }}',
'{{ description }}',
'{{ displayName }}',
'{{ documentation }}',
'{{ lifecycle }}',
'{{ name }}',
'{{ selectedDeployment }}',
'{{ 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: accreditation
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: 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: compliance
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: deployments
value:
- "{{ deployments }}"
description: |
Optional. The deployments linked directly to this API version. Only directly-linked deployments are returned; deployments linked to this version's specs or operations are not included. 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: description
value: "{{ description }}"
description: |
Optional. The description of the version.
- name: displayName
value: "{{ displayName }}"
description: |
Required. The display name of the version.
- name: documentation
description: |
Optional. The documentation of the version.
value:
externalUri: "{{ externalUri }}"
- name: lifecycle
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 version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
- 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: 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__accreditation = '{{ accreditation }}',
data__attributes = '{{ attributes }}',
data__compliance = '{{ compliance }}',
data__deployments = '{{ deployments }}',
data__description = '{{ description }}',
data__displayName = '{{ displayName }}',
data__documentation = '{{ documentation }}',
data__lifecycle = '{{ lifecycle }}',
data__name = '{{ name }}',
data__selectedDeployment = '{{ selectedDeployment }}'
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 }}'
;