Skip to main content

subscriptions

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

Overview​

Namesubscriptions
TypeResource
Idgoogle.apigee.subscriptions

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. Name of the API product subscription.
apiproductstringRequired. Name of the API product for which the appgroup is purchasing a subscription.
createdAtstring (int64)Output only. Time when the API product subscription was created in milliseconds since epoch.
endTimestring (int64)Output only. Time when the API product subscription ends in milliseconds since epoch.
lastModifiedAtstring (int64)Output only. Time when the API product subscription was last modified in milliseconds since epoch.
startTimestring (int64)Output only. Time when the API product subscription starts in milliseconds since epoch.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
organizations_appgroups_subscriptions_getselectorganizationsId, appgroupsId, subscriptionsIdGet an api product subscription for an appgroup.
organizations_developers_subscriptions_getselectorganizationsId, developersId, subscriptionsIdGets details for an API product subscription.
organizations_appgroups_subscriptions_listselectorganizationsId, appgroupsIdpageSize, pageTokenList all api product subscriptions for an appgroup.
organizations_developers_subscriptions_listselectorganizationsId, developersIdcount, startKeyLists all API product subscriptions for a developer.
organizations_appgroups_subscriptions_createinsertorganizationsId, appgroupsIdCreates a subscription to an API product.
organizations_developers_subscriptions_createinsertorganizationsId, developersIdCreates a subscription to an API product.
organizations_appgroups_subscriptions_expireexecorganizationsId, appgroupsId, subscriptionsIdExpires an API product subscription immediately.
organizations_developers_subscriptions_expireexecorganizationsId, developersId, subscriptionsIdExpires an API product subscription immediately.

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
appgroupsIdstring
developersIdstring
organizationsIdstring
subscriptionsIdstring
countinteger (int32)
pageSizeinteger (int32)
pageTokenstring
startKeystring

SELECT examples​

Get an api product subscription for an appgroup.

SELECT
name,
apiproduct,
createdAt,
endTime,
lastModifiedAt,
startTime
FROM google.apigee.subscriptions
WHERE organizationsId = '{{ organizationsId }}' -- required
AND appgroupsId = '{{ appgroupsId }}' -- required
AND subscriptionsId = '{{ subscriptionsId }}' -- required
;

INSERT examples​

Creates a subscription to an API product.

INSERT INTO google.apigee.subscriptions (
data__apiproduct,
organizationsId,
appgroupsId
)
SELECT
'{{ apiproduct }}',
'{{ organizationsId }}',
'{{ appgroupsId }}'
RETURNING
name,
apiproduct,
createdAt,
endTime,
lastModifiedAt,
startTime
;

Lifecycle Methods​

Expires an API product subscription immediately.

EXEC google.apigee.subscriptions.organizations_appgroups_subscriptions_expire
@organizationsId='{{ organizationsId }}' --required,
@appgroupsId='{{ appgroupsId }}' --required,
@subscriptionsId='{{ subscriptionsId }}' --required
;