Skip to main content

external_apis

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

Overview

Nameexternal_apis
TypeResource
Idgoogle.apihub.external_apis

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Format: projects/{project}/locations/{location}/externalApi/{externalApi}.
attributesobjectOptional. 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.
createTimestring (google-datetime)Output only. Creation timestamp.
descriptionstringOptional. Description of the external API. Max length is 2000 characters (Unicode Code Points).
displayNamestringRequired. Display name of the external API. Max length is 63 characters (Unicode Code Points).
documentationobjectOptional. Documentation of the external API. (id: GoogleCloudApihubV1Documentation)
endpointsarrayOptional. List of endpoints on which this API is accessible.
pathsarrayOptional. List of paths served by this API.
updateTimestring (google-datetime)Output only. Last update timestamp.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, externalApisIdGet details about an External API resource in the API hub.
listselectprojectsId, locationsIdpageSize, pageTokenList External API resources in the API hub.
createinsertprojectsId, locationsIdexternalApiIdCreate an External API resource in the API hub.
patchupdateprojectsId, locationsId, externalApisIdupdateMaskUpdate an External API resource in the API hub. The following fields can be updated: * display_name * description * documentation * endpoints * paths The update_mask should be used to specify the fields being updated.
deletedeleteprojectsId, locationsId, externalApisIdDelete an External API resource in the API hub.

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
externalApisIdstring
locationsIdstring
projectsIdstring
externalApiIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Get details about an External API resource in the API hub.

SELECT
name,
attributes,
createTime,
description,
displayName,
documentation,
endpoints,
paths,
updateTime
FROM google.apihub.external_apis
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND externalApisId = '{{ externalApisId }}' -- required;

INSERT examples

Create an External API resource in the API hub.

INSERT INTO google.apihub.external_apis (
data__name,
data__displayName,
data__description,
data__endpoints,
data__paths,
data__documentation,
data__attributes,
projectsId,
locationsId,
externalApiId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ endpoints }}',
'{{ paths }}',
'{{ documentation }}',
'{{ attributes }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ externalApiId }}'
RETURNING
name,
attributes,
createTime,
description,
displayName,
documentation,
endpoints,
paths,
updateTime
;

UPDATE examples

Update an External API resource in the API hub. The following fields can be updated: * display_name * description * documentation * endpoints * paths The update_mask should be used to specify the fields being updated.

UPDATE google.apihub.external_apis
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__endpoints = '{{ endpoints }}',
data__paths = '{{ paths }}',
data__documentation = '{{ documentation }}',
data__attributes = '{{ attributes }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND externalApisId = '{{ externalApisId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
attributes,
createTime,
description,
displayName,
documentation,
endpoints,
paths,
updateTime;

DELETE examples

Delete an External API resource in the API hub.

DELETE FROM google.apihub.external_apis
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND externalApisId = '{{ externalApisId }}' --required;