Skip to main content

apis

Creates, updates, deletes, gets or lists an apis resource.

Overview

Nameapis
TypeResource
Idgoogle.apigateway.apis

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Resource name of the API. Format: projects/{project}/locations/global/apis/{api}
createTimestring (google-datetime)Output only. Created time.
displayNamestringOptional. Display name.
labelsobjectOptional. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources
managedServicestringOptional. Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.
statestringOutput only. State of the API.
updateTimestring (google-datetime)Output only. Updated time.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, apisIdGets details of a single Api.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists Apis in a given project and location.
createinsertprojectsId, locationsIdapiIdCreates a new Api in a given project and location.
patchupdateprojectsId, locationsId, apisIdupdateMaskUpdates the parameters of a single Api.
deletedeleteprojectsId, locationsId, apisIdDeletes a single Api.

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
apiIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single Api.

SELECT
name,
createTime,
displayName,
labels,
managedService,
state,
updateTime
FROM google.apigateway.apis
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required;

INSERT examples

Creates a new Api in a given project and location.

INSERT INTO google.apigateway.apis (
data__labels,
data__displayName,
data__managedService,
projectsId,
locationsId,
apiId
)
SELECT
'{{ labels }}',
'{{ displayName }}',
'{{ managedService }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ apiId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single Api.

UPDATE google.apigateway.apis
SET
data__labels = '{{ labels }}',
data__displayName = '{{ displayName }}',
data__managedService = '{{ managedService }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single Api.

DELETE FROM google.apigateway.apis
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required;