Skip to main content

versions

Creates, updates, deletes, gets or lists a versions resource.

Overview

Nameversions
TypeResource
Idgoogle.apigeeregistry.versions

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringResource name.
annotationsobjectAnnotations attach non-identifying metadata to resources. Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts.
createTimestring (google-datetime)Output only. Creation timestamp.
descriptionstringA detailed description.
displayNamestringHuman-meaningful name.
labelsobjectLabels attach identifying metadata to resources. Identifying metadata can be used to filter list operations. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry.googleapis.com/ and cannot be changed.
primarySpecstringThe primary spec for this version. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}
statestringA user-definable description of the lifecycle phase of this API version. Format: free-form, but we expect single words that describe API maturity, e.g., "CONCEPT", "DESIGN", "DEVELOPMENT", "STAGING", "PRODUCTION", "DEPRECATED", "RETIRED".
updateTimestring (google-datetime)Output only. Last update timestamp.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_apis_versions_getselectprojectsId, locationsId, apisId, versionsIdReturns a specified version.
projects_locations_apis_versions_listselectprojectsId, locationsId, apisIdpageSize, pageToken, filter, orderByReturns matching versions.
projects_locations_apis_versions_createinsertprojectsId, locationsId, apisIdapiVersionIdCreates a specified version.
projects_locations_apis_versions_patchupdateprojectsId, locationsId, apisId, versionsIdupdateMask, allowMissingUsed to modify a specified version.
projects_locations_apis_versions_deletedeleteprojectsId, locationsId, apisId, versionsIdforceRemoves a specified version and all of the resources that it owns.

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.

NameDatatypeDescription
apisIdstring
locationsIdstring
projectsIdstring
versionsIdstring
allowMissingboolean
apiVersionIdstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Returns a specified version.

SELECT
name,
annotations,
createTime,
description,
displayName,
labels,
primarySpec,
state,
updateTime
FROM google.apigeeregistry.versions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required
AND versionsId = '{{ versionsId }}' -- required;

INSERT examples

Creates a specified version.

INSERT INTO google.apigeeregistry.versions (
data__name,
data__displayName,
data__description,
data__state,
data__labels,
data__annotations,
data__primarySpec,
projectsId,
locationsId,
apisId,
apiVersionId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ state }}',
'{{ labels }}',
'{{ annotations }}',
'{{ primarySpec }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ apisId }}',
'{{ apiVersionId }}'
RETURNING
name,
annotations,
createTime,
description,
displayName,
labels,
primarySpec,
state,
updateTime
;

UPDATE examples

Used to modify a specified version.

UPDATE google.apigeeregistry.versions
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__state = '{{ state }}',
data__labels = '{{ labels }}',
data__annotations = '{{ annotations }}',
data__primarySpec = '{{ primarySpec }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND updateMask = '{{ updateMask}}'
AND allowMissing = {{ allowMissing}}
RETURNING
name,
annotations,
createTime,
description,
displayName,
labels,
primarySpec,
state,
updateTime;

DELETE examples

Removes a specified version and all of the resources that it owns.

DELETE FROM google.apigeeregistry.versions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND force = '{{ force }}';