Skip to main content

services

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

Overview

Nameservices
TypeResource
Idgoogle.apphub.services

Fields

NameDatatypeDescription
namestringIdentifier. The resource name of a Service. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/services/{service-id}"
descriptionstringOptional. User-defined description of a Service. Can have a maximum length of 2048 characters.
attributesobjectConsumer provided attributes.
createTimestringOutput only. Create time.
discoveredServicestringRequired. Immutable. The resource name of the original discovered service.
displayNamestringOptional. User-defined name for the Service. Can have a maximum length of 63 characters.
servicePropertiesobjectProperties of an underlying cloud resource that can comprise a Service.
serviceReferenceobjectReference to an underlying networking resource that can comprise a Service.
statestringOutput only. Service state.
uidstringOutput only. A universally unique identifier (UUID) for the Service in the UUID4 format.
updateTimestringOutput only. Update time.

Methods

NameAccessible byRequired ParamsDescription
getSELECTapplicationsId, locationsId, projectsId, servicesIdGets a Service in an Application.
listSELECTapplicationsId, locationsId, projectsIdLists Services in an Application.
createINSERTapplicationsId, locationsId, projectsIdCreates a Service in an Application.
deleteDELETEapplicationsId, locationsId, projectsId, servicesIdDeletes a Service from an Application.
patchUPDATEapplicationsId, locationsId, projectsId, servicesIdUpdates a Service in an Application.

SELECT examples

Lists Services in an Application.

SELECT
name,
description,
attributes,
createTime,
discoveredService,
displayName,
serviceProperties,
serviceReference,
state,
uid,
updateTime
FROM google.apphub.services
WHERE applicationsId = '{{ applicationsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new services resource.

/*+ create */
INSERT INTO google.apphub.services (
applicationsId,
locationsId,
projectsId,
name,
displayName,
description,
attributes,
discoveredService
)
SELECT
'{{ applicationsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ attributes }}',
'{{ discoveredService }}'
;

UPDATE example

Updates a services resource.

/*+ update */
UPDATE google.apphub.services
SET
name = '{{ name }}',
displayName = '{{ displayName }}',
description = '{{ description }}',
attributes = '{{ attributes }}',
discoveredService = '{{ discoveredService }}'
WHERE
applicationsId = '{{ applicationsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND servicesId = '{{ servicesId }}';

DELETE example

Deletes the specified services resource.

/*+ delete */
DELETE FROM google.apphub.services
WHERE applicationsId = '{{ applicationsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND servicesId = '{{ servicesId }}';