get method
Get a ServiceLevelObjective by name.
Request parameters:
name
- Required. Resource name of the ServiceLevelObjective to get. The
format is:
projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
Value must have pattern
^\[^/\]+/\[^/\]+/services/\[^/\]+/serviceLevelObjectives/\[^/\]+$
.
view
- View of the ServiceLevelObjective to return. If DEFAULT, return
the ServiceLevelObjective as originally defined. If EXPLICIT and the
ServiceLevelObjective is defined in terms of a BasicSli, replace the
BasicSli with a RequestBasedSli spelling out how the SLI is computed.
Possible string values are:
- "VIEW_UNSPECIFIED" : Same as FULL.
- "FULL" : Return the embedded ServiceLevelIndicator in the form in which it was defined. If it was defined using a BasicSli, return that BasicSli.
- "EXPLICIT" : For ServiceLevelIndicators using BasicSli articulation, instead return the ServiceLevelIndicator with its mode of computation fully spelled out as a RequestBasedSli. For ServiceLevelIndicators using RequestBasedSli or WindowsBasedSli, return the ServiceLevelIndicator as it was provided.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ServiceLevelObjective.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<ServiceLevelObjective> get(
core.String name, {
core.String? view,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (view != null) 'view': [view],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v3/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ServiceLevelObjective.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}