Skip to main content

apis

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

Overview

Nameapis
TypeResource
Idgoogle.apigee.apis

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Name of the API proxy.
apiProxyTypestringOutput only. The type of the API proxy.
labelsobjectUser labels applied to this API Proxy.
latestRevisionIdstringOutput only. The id of the most recently created revision for this api proxy.
metaDataobjectOutput only. Metadata describing the API proxy. (id: GoogleCloudApigeeV1EntityMetadata)
readOnlybooleanOutput only. Whether this proxy is read-only. A read-only proxy cannot have new revisions created through calls to CreateApiProxyRevision. A proxy is read-only if it was generated by an archive.
revisionarrayOutput only. List of revisions defined for the API proxy.
spacestringOptional. The id of the space this proxy is associated with. Any IAM policies applied to the space will control access to this proxy. To learn how Spaces can be used to manage resources, read the Apigee Spaces Overview.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
organizations_apis_getselectorganizationsId, apisIdGets an API proxy including a list of existing revisions.
organizations_apis_listselectorganizationsIdincludeRevisions, includeMetaData, spaceLists the names of all API proxies in an organization. The names returned correspond to the names defined in the configuration files for each API proxy. If the resource has the space attribute set, the response may not return all resources. To learn more, read the Apigee Spaces Overview.
organizations_apis_createinsertorganizationsIdname, action, validate, spaceCreates an API proxy. The API proxy created will not be accessible at runtime until it is deployed to an environment. Create a new API proxy by setting the name query parameter to the name of the API proxy. Import an API proxy configuration bundle stored in zip format on your local machine to your organization by doing the following: * Set the name query parameter to the name of the API proxy. * Set the action query parameter to import. * Set the Content-Type header to multipart/form-data. * Pass as a file the name of API proxy configuration bundle stored in zip format on your local machine using the file form field. Note: To validate the API proxy configuration bundle only without importing it, set the action query parameter to validate. When importing an API proxy configuration bundle, if the API proxy does not exist, it will be created. If the API proxy exists, then a new revision is created. Invalid API proxy configurations are rejected, and a list of validation errors is returned to the client.
organizations_apis_patchupdateorganizationsId, apisIdupdateMaskUpdates an existing API proxy.
organizations_apis_deletedeleteorganizationsId, apisIdDeletes an API proxy and all associated endpoints, policies, resources, and revisions. The API proxy must be undeployed before you can delete it.
organizations_apis_moveexecorganizationsId, apisIdMoves an API proxy to a different space.

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
organizationsIdstring
actionstring
includeMetaDataboolean
includeRevisionsboolean
namestring
spacestring
updateMaskstring (google-fieldmask)
validateboolean

SELECT examples

Gets an API proxy including a list of existing revisions.

SELECT
name,
apiProxyType,
labels,
latestRevisionId,
metaData,
readOnly,
revision,
space
FROM google.apigee.apis
WHERE organizationsId = '{{ organizationsId }}' -- required
AND apisId = '{{ apisId }}' -- required;

INSERT examples

Creates an API proxy. The API proxy created will not be accessible at runtime until it is deployed to an environment. Create a new API proxy by setting the name query parameter to the name of the API proxy. Import an API proxy configuration bundle stored in zip format on your local machine to your organization by doing the following: * Set the name query parameter to the name of the API proxy. * Set the action query parameter to import. * Set the Content-Type header to multipart/form-data. * Pass as a file the name of API proxy configuration bundle stored in zip format on your local machine using the file form field. Note: To validate the API proxy configuration bundle only without importing it, set the action query parameter to validate. When importing an API proxy configuration bundle, if the API proxy does not exist, it will be created. If the API proxy exists, then a new revision is created. Invalid API proxy configurations are rejected, and a list of validation errors is returned to the client.

INSERT INTO google.apigee.apis (
data__contentType,
data__data,
data__extensions,
organizationsId,
name,
action,
validate,
space
)
SELECT
'{{ contentType }}',
'{{ data }}',
'{{ extensions }}',
'{{ organizationsId }}',
'{{ name }}',
'{{ action }}',
'{{ validate }}',
'{{ space }}'
RETURNING
name,
archive,
basepaths,
configurationVersion,
contextInfo,
createdAt,
description,
displayName,
entityMetaDataAsProperties,
hasExtensiblePolicy,
integrationEndpoints,
lastModifiedAt,
policies,
proxies,
proxyEndpoints,
resourceFiles,
resources,
revision,
sharedFlows,
spec,
targetEndpoints,
targetServers,
targets,
teams,
type
;

UPDATE examples

Updates an existing API proxy.

UPDATE google.apigee.apis
SET
data__labels = '{{ labels }}',
data__space = '{{ space }}'
WHERE
organizationsId = '{{ organizationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
apiProxyType,
labels,
latestRevisionId,
metaData,
readOnly,
revision,
space;

DELETE examples

Deletes an API proxy and all associated endpoints, policies, resources, and revisions. The API proxy must be undeployed before you can delete it.

DELETE FROM google.apigee.apis
WHERE organizationsId = '{{ organizationsId }}' --required
AND apisId = '{{ apisId }}' --required;

Lifecycle Methods

Moves an API proxy to a different space.

EXEC google.apigee.apis.organizations_apis_move 
@organizationsId='{{ organizationsId }}' --required,
@apisId='{{ apisId }}' --required
@@json=
'{
"space": "{{ space }}"
}';