Skip to main content

observation_sources

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

Overview

Nameobservation_sources
TypeResource
Idgoogle.apim.observation_sources

Fields

NameDatatypeDescription
namestringIdentifier. name of resource For MVP, each region can only have 1 source.
createTimestringOutput only. [Output only] Create time stamp
gclbObservationSourceobjectThe GCLB observation source.
statestringOutput only. The observation source state
updateTimestringOutput only. [Output only] Update time stamp

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, observationSourcesId, projectsIdGetObservationSource retrieves a single ObservationSource by name.
listSELECTlocationsId, projectsIdListObservationSources gets all ObservationSources for a given project and location.
createINSERTlocationsId, projectsIdCreateObservationSource creates a new ObservationSource but does not affect any deployed infrastructure. It is a configuration that can be used in an Observation Job to collect data about APIs running in user's dataplane.
deleteDELETElocationsId, observationSourcesId, projectsIdDeleteObservationSource deletes an observation source. This method will fail if the observation source is currently being used by any ObservationJob, even if not enabled.

SELECT examples

ListObservationSources gets all ObservationSources for a given project and location.

SELECT
name,
createTime,
gclbObservationSource,
state,
updateTime
FROM google.apim.observation_sources
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.apim.observation_sources (
locationsId,
projectsId,
gclbObservationSource,
name
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ gclbObservationSource }}',
'{{ name }}'
;

DELETE example

Deletes the specified observation_sources resource.

/*+ delete */
DELETE FROM google.apim.observation_sources
WHERE locationsId = '{{ locationsId }}'
AND observationSourcesId = '{{ observationSourcesId }}'
AND projectsId = '{{ projectsId }}';