Skip to main content

observation_sources

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

Overview

Nameobservation_sources
TypeResource
Idgoogle.apim.observation_sources

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. name of resource For MVP, each region can only have 1 source.
createTimestring (google-datetime)Output only. [Output only] Create time stamp
gclbObservationSourceobjectThe GCLB observation source (id: GclbObservationSource)
statestringOutput only. The observation source state
updateTimestring (google-datetime)Output only. [Output only] Update time stamp

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, observationSourcesIdGetObservationSource retrieves a single ObservationSource by name.
listselectprojectsId, locationsIdpageSize, pageTokenListObservationSources gets all ObservationSources for a given project and location.
createinsertprojectsId, locationsIdobservationSourceId, requestIdCreateObservationSource 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.
deletedeleteprojectsId, locationsId, observationSourcesIdDeleteObservationSource deletes an observation source. This method will fail if the observation source is currently being used by any ObservationJob, even if not enabled.

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
locationsIdstring
observationSourcesIdstring
projectsIdstring
observationSourceIdstring
pageSizeinteger (int32)
pageTokenstring
requestIdstring

SELECT examples

GetObservationSource retrieves a single ObservationSource by name.

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

INSERT examples

CreateObservationSource 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.

INSERT INTO google.apim.observation_sources (
data__gclbObservationSource,
data__name,
projectsId,
locationsId,
observationSourceId,
requestId
)
SELECT
'{{ gclbObservationSource }}',
'{{ name }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ observationSourceId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

DeleteObservationSource deletes an observation source. This method will fail if the observation source is currently being used by any ObservationJob, even if not enabled.

DELETE FROM google.apim.observation_sources
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND observationSourcesId = '{{ observationSourcesId }}' --required;