Request service health events relevant to your Google Cloud project. v1
Package
@google-cloud/servicehealthConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of ServiceHealthClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
locationsClient
locationsClient: LocationsClient;
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
serviceHealthStub
serviceHealthStub?: Promise<{
[name: string]: Function;
}>;
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns | |
---|---|
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
eventPath(project, location, event)
eventPath(project: string, location: string, event: string): string;
Return a fully-qualified event resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
event |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
getEvent(request, options)
getEvent(request?: protos.google.cloud.servicehealth.v1.IGetEventRequest, options?: CallOptions): Promise<[
protos.google.cloud.servicehealth.v1.IEvent,
protos.google.cloud.servicehealth.v1.IGetEventRequest | undefined,
{} | undefined
]>;
Retrieves a resource containing information about an event.
Parameters | |
---|---|
Name | Description |
request |
IGetEventRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.servicehealth.v1.IEvent,
protos.google.cloud.servicehealth.v1.IGetEventRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Unique name of the event in this scope including project
* and location using the form
* `projects/{project_id}/locations/{location}/events/{event_id}`.
* `project_id` - Project ID of the project that contains the event.
* `location` - The location to get the service health events from.
* `event_id` - Event ID to retrieve.
*/
// const name = 'abc123'
// Imports the Servicehealth library
const {ServiceHealthClient} = require('@google-cloud/servicehealth').v1;
// Instantiates a client
const servicehealthClient = new ServiceHealthClient();
async function callGetEvent() {
// Construct request
const request = {
name,
};
// Run request
const response = await servicehealthClient.getEvent(request);
console.log(response);
}
callGetEvent();
getEvent(request, options, callback)
getEvent(request: protos.google.cloud.servicehealth.v1.IGetEventRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicehealth.v1.IEvent, protos.google.cloud.servicehealth.v1.IGetEventRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetEventRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.servicehealth.v1.IEvent, protos.google.cloud.servicehealth.v1.IGetEventRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getEvent(request, callback)
getEvent(request: protos.google.cloud.servicehealth.v1.IGetEventRequest, callback: Callback<protos.google.cloud.servicehealth.v1.IEvent, protos.google.cloud.servicehealth.v1.IGetEventRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetEventRequest
|
callback |
Callback<protos.google.cloud.servicehealth.v1.IEvent, protos.google.cloud.servicehealth.v1.IGetEventRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getLocation(request, options, callback)
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
Gets information about a location.
Parameters | |
---|---|
Name | Description |
request |
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Call options. See CallOptions for more details. |
callback |
Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
Promise<google.cloud.location.ILocation> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
const [response] = await client.getLocation(request);
getOrganizationEvent(request, options)
getOrganizationEvent(request?: protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest, options?: CallOptions): Promise<[
protos.google.cloud.servicehealth.v1.IOrganizationEvent,
(protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest | undefined),
{} | undefined
]>;
Retrieves a resource containing information about an event affecting an organization .
Parameters | |
---|---|
Name | Description |
request |
IGetOrganizationEventRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.servicehealth.v1.IOrganizationEvent,
(protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Unique name of the event in this scope including organization and
* event ID using the form
* `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
* `organization_id` - ID (number) of the project that contains the event. To
* get your `organization_id`, see
* Getting your organization resource
* ID (https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
* `event_id` - Organization event ID to retrieve.
*/
// const name = 'abc123'
// Imports the Servicehealth library
const {ServiceHealthClient} = require('@google-cloud/servicehealth').v1;
// Instantiates a client
const servicehealthClient = new ServiceHealthClient();
async function callGetOrganizationEvent() {
// Construct request
const request = {
name,
};
// Run request
const response = await servicehealthClient.getOrganizationEvent(request);
console.log(response);
}
callGetOrganizationEvent();
getOrganizationEvent(request, options, callback)
getOrganizationEvent(request: protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicehealth.v1.IOrganizationEvent, protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetOrganizationEventRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.servicehealth.v1.IOrganizationEvent, protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getOrganizationEvent(request, callback)
getOrganizationEvent(request: protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest, callback: Callback<protos.google.cloud.servicehealth.v1.IOrganizationEvent, protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetOrganizationEventRequest
|
callback |
Callback<protos.google.cloud.servicehealth.v1.IOrganizationEvent, protos.google.cloud.servicehealth.v1.IGetOrganizationEventRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getOrganizationImpact(request, options)
getOrganizationImpact(request?: protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest, options?: CallOptions): Promise<[
protos.google.cloud.servicehealth.v1.IOrganizationImpact,
(protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest | undefined),
{} | undefined
]>;
Retrieves a resource containing information about impact to an asset under an organization affected by a service health event.
Parameters | |
---|---|
Name | Description |
request |
IGetOrganizationImpactRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.servicehealth.v1.IOrganizationImpact,
(protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing OrganizationImpact. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource using the form
* `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
* `organization_id` - ID (number) of the organization that contains the
* event. To get your `organization_id`, see
* Getting your organization resource
* ID (https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
* `organization_impact_id` - ID of the OrganizationImpact
* resource (/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
*/
// const name = 'abc123'
// Imports the Servicehealth library
const {ServiceHealthClient} = require('@google-cloud/servicehealth').v1;
// Instantiates a client
const servicehealthClient = new ServiceHealthClient();
async function callGetOrganizationImpact() {
// Construct request
const request = {
name,
};
// Run request
const response = await servicehealthClient.getOrganizationImpact(request);
console.log(response);
}
callGetOrganizationImpact();
getOrganizationImpact(request, options, callback)
getOrganizationImpact(request: protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicehealth.v1.IOrganizationImpact, protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetOrganizationImpactRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.servicehealth.v1.IOrganizationImpact, protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getOrganizationImpact(request, callback)
getOrganizationImpact(request: protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest, callback: Callback<protos.google.cloud.servicehealth.v1.IOrganizationImpact, protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetOrganizationImpactRequest
|
callback |
Callback<protos.google.cloud.servicehealth.v1.IOrganizationImpact, protos.google.cloud.servicehealth.v1.IGetOrganizationImpactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub. |
listEvents(request, options)
listEvents(request?: protos.google.cloud.servicehealth.v1.IListEventsRequest, options?: CallOptions): Promise<[
protos.google.cloud.servicehealth.v1.IEvent[],
protos.google.cloud.servicehealth.v1.IListEventsRequest | null,
protos.google.cloud.servicehealth.v1.IListEventsResponse
]>;
Lists events under a given project and location.
Parameters | |
---|---|
Name | Description |
request |
IListEventsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.servicehealth.v1.IEvent[],
protos.google.cloud.servicehealth.v1.IListEventsRequest | null,
protos.google.cloud.servicehealth.v1.IListEventsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listEvents(request, options, callback)
listEvents(request: protos.google.cloud.servicehealth.v1.IListEventsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.servicehealth.v1.IListEventsRequest, protos.google.cloud.servicehealth.v1.IListEventsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IEvent>): void;
Parameters | |
---|---|
Name | Description |
request |
IListEventsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.servicehealth.v1.IListEventsRequest, protos.google.cloud.servicehealth.v1.IListEventsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IEvent>
|
Returns | |
---|---|
Type | Description |
void |
listEvents(request, callback)
listEvents(request: protos.google.cloud.servicehealth.v1.IListEventsRequest, callback: PaginationCallback<protos.google.cloud.servicehealth.v1.IListEventsRequest, protos.google.cloud.servicehealth.v1.IListEventsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IEvent>): void;
Parameters | |
---|---|
Name | Description |
request |
IListEventsRequest
|
callback |
PaginationCallback<protos.google.cloud.servicehealth.v1.IListEventsRequest, protos.google.cloud.servicehealth.v1.IListEventsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IEvent>
|
Returns | |
---|---|
Type | Description |
void |
listEventsAsync(request, options)
listEventsAsync(request?: protos.google.cloud.servicehealth.v1.IListEventsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.servicehealth.v1.IEvent>;
Equivalent to listEvents
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListEventsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.servicehealth.v1.IEvent> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent value using the form
* `projects/{project_id}/locations/{location}/events`.
* `project_id` - ID of the project for which to list service health
* events.
* `location` - The location to get the service health events from.
* To retrieve service health events of category = INCIDENT, use `location` =
* `global`.
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of events that should be returned. Acceptable
* values are 1 to 100, inclusive. (The default value is 10.) If more results
* are available, the service returns a next_page_token that you can use to
* get the next page of results in subsequent list requests. The service may
* return fewer events than the requested page_size.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
* Provide Page token returned by a previous `ListEvents` call to retrieve the
* next page of results. When paginating, all other parameters provided to
* `ListEvents` must match the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Optional. A filter expression that filters resources listed in the
* response. The expression takes the following forms:
* * field=value for `category` and `state`
* * field <, >, <=, or >= value for `update_time`
* Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
*
* Multiple filter queries are separated by spaces. Example:
* `category=INCIDENT state=ACTIVE`.
* By default, each expression is an AND expression. However, you can include
* AND and OR expressions explicitly.
* Filter is supported for the following fields: `category`, `state`,
* `update_time`
*/
// const filter = 'abc123'
/**
* Optional. Event fields to include in response.
*/
// const view = {}
// Imports the Servicehealth library
const {ServiceHealthClient} = require('@google-cloud/servicehealth').v1;
// Instantiates a client
const servicehealthClient = new ServiceHealthClient();
async function callListEvents() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await servicehealthClient.listEventsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListEvents();
listEventsStream(request, options)
listEventsStream(request?: protos.google.cloud.servicehealth.v1.IListEventsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListEventsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listLocationsAsync(request, options)
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
Lists information about the supported locations for this service. Returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<google.cloud.location.ILocation> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listOrganizationEvents(request, options)
listOrganizationEvents(request?: protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, options?: CallOptions): Promise<[
protos.google.cloud.servicehealth.v1.IOrganizationEvent[],
protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest | null,
protos.google.cloud.servicehealth.v1.IListOrganizationEventsResponse
]>;
Lists organization events under a given organization and location.
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationEventsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.servicehealth.v1.IOrganizationEvent[],
protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest | null,
protos.google.cloud.servicehealth.v1.IListOrganizationEventsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listOrganizationEvents(request, options, callback)
listOrganizationEvents(request: protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, protos.google.cloud.servicehealth.v1.IListOrganizationEventsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IOrganizationEvent>): void;
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationEventsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, protos.google.cloud.servicehealth.v1.IListOrganizationEventsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IOrganizationEvent>
|
Returns | |
---|---|
Type | Description |
void |
listOrganizationEvents(request, callback)
listOrganizationEvents(request: protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, callback: PaginationCallback<protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, protos.google.cloud.servicehealth.v1.IListOrganizationEventsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IOrganizationEvent>): void;
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationEventsRequest
|
callback |
PaginationCallback<protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, protos.google.cloud.servicehealth.v1.IListOrganizationEventsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IOrganizationEvent>
|
Returns | |
---|---|
Type | Description |
void |
listOrganizationEventsAsync(request, options)
listOrganizationEventsAsync(request?: protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.servicehealth.v1.IOrganizationEvent>;
Equivalent to listOrganizationEvents
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationEventsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.servicehealth.v1.IOrganizationEvent> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent value using the form
* `organizations/{organization_id}/locations/{location}/organizationEvents`.
* `organization_id` - ID (number) of the project that contains the event. To
* get your `organization_id`, see
* Getting your organization resource
* ID (https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
* `location` - The location to get the service health events from. To
* retrieve service health events of category = INCIDENT, use `location` =
* `global`.
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of events that should be returned. Acceptable
* values are `1` to `100`, inclusive. (The default value is `10`.) If more
* results are available, the service returns a `next_page_token` that you can
* use to get the next page of results in subsequent list requests. The
* service may return fewer events than the requested `page_size`.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
* Provide Page token returned by a previous `ListOrganizationEvents` call to
* retrieve the next page of results.
* When paginating, all other parameters provided to
* `ListOrganizationEvents` must match the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Optional. A filter expression that filters resources listed in the
* response. The expression takes the following forms:
* * field=value for `category` and `state`
* * field <, >, <=, or >= value for `update_time`
* Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
* Multiple filter queries are space-separated. Example:
* `category=INCIDENT state=ACTIVE`.
* By default, each expression is an AND expression. However, you can include
* AND and OR expressions explicitly.
* Filter is supported for the following fields: `category`, `state`,
* `update_time`
*/
// const filter = 'abc123'
/**
* Optional. OrganizationEvent fields to include in response.
*/
// const view = {}
// Imports the Servicehealth library
const {ServiceHealthClient} = require('@google-cloud/servicehealth').v1;
// Instantiates a client
const servicehealthClient = new ServiceHealthClient();
async function callListOrganizationEvents() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await servicehealthClient.listOrganizationEventsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListOrganizationEvents();
listOrganizationEventsStream(request, options)
listOrganizationEventsStream(request?: protos.google.cloud.servicehealth.v1.IListOrganizationEventsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationEventsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listOrganizationImpacts(request, options)
listOrganizationImpacts(request?: protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, options?: CallOptions): Promise<[
protos.google.cloud.servicehealth.v1.IOrganizationImpact[],
protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest | null,
protos.google.cloud.servicehealth.v1.IListOrganizationImpactsResponse
]>;
Lists assets impacted by organization events under a given organization and location.
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationImpactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.servicehealth.v1.IOrganizationImpact[],
protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest | null,
protos.google.cloud.servicehealth.v1.IListOrganizationImpactsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of OrganizationImpact. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listOrganizationImpacts(request, options, callback)
listOrganizationImpacts(request: protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, protos.google.cloud.servicehealth.v1.IListOrganizationImpactsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IOrganizationImpact>): void;
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationImpactsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, protos.google.cloud.servicehealth.v1.IListOrganizationImpactsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IOrganizationImpact>
|
Returns | |
---|---|
Type | Description |
void |
listOrganizationImpacts(request, callback)
listOrganizationImpacts(request: protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, callback: PaginationCallback<protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, protos.google.cloud.servicehealth.v1.IListOrganizationImpactsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IOrganizationImpact>): void;
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationImpactsRequest
|
callback |
PaginationCallback<protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, protos.google.cloud.servicehealth.v1.IListOrganizationImpactsResponse | null | undefined, protos.google.cloud.servicehealth.v1.IOrganizationImpact>
|
Returns | |
---|---|
Type | Description |
void |
listOrganizationImpactsAsync(request, options)
listOrganizationImpactsAsync(request?: protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.servicehealth.v1.IOrganizationImpact>;
Equivalent to listOrganizationImpacts
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationImpactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.servicehealth.v1.IOrganizationImpact> | {Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing OrganizationImpact. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent value using the form
* `organizations/{organization_id}/locations/{location}/organizationImpacts`.
* `organization_id` - ID (number) of the project that contains the event. To
* get your `organization_id`, see
* Getting your organization resource
* ID (https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of events that should be returned. Acceptable
* values are `1` to `100`, inclusive. The default value is `10`.
* If more results are available, the service returns a
* `next_page_token` that can be used to get the next page of results in
* subsequent list requests. The service may return fewer
* impacts (/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
* than the requested `page_size`.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
* Provide `page_token` returned by a previous `ListOrganizationImpacts` call
* to retrieve the next page of results.
* When paginating, all other parameters provided to `ListOrganizationImpacts`
* must match the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Optional. A filter expression that filters resources listed in the
* response. The expression is in the form of `field:value` for checking if a
* repeated field contains a value.
* Example:
* `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
* To get your `{organization_id}`, see
* Getting your organization resource
* ID (https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
* Multiple filter queries are separated by spaces.
* By default, each expression is an AND expression. However, you can include
* AND and OR expressions explicitly.
* Filter is supported for the following fields: `events`.
*/
// const filter = 'abc123'
// Imports the Servicehealth library
const {ServiceHealthClient} = require('@google-cloud/servicehealth').v1;
// Instantiates a client
const servicehealthClient = new ServiceHealthClient();
async function callListOrganizationImpacts() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await servicehealthClient.listOrganizationImpactsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListOrganizationImpacts();
listOrganizationImpactsStream(request, options)
listOrganizationImpactsStream(request?: protos.google.cloud.servicehealth.v1.IListOrganizationImpactsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListOrganizationImpactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing OrganizationImpact on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
matchEventFromEventName(eventName)
matchEventFromEventName(eventName: string): string | number;
Parse the event from Event resource.
Parameter | |
---|---|
Name | Description |
eventName |
string
A fully-qualified path representing Event resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the event. |
matchEventFromOrganizationEventName(organizationEventName)
matchEventFromOrganizationEventName(organizationEventName: string): string | number;
Parse the event from OrganizationEvent resource.
Parameter | |
---|---|
Name | Description |
organizationEventName |
string
A fully-qualified path representing OrganizationEvent resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the event. |
matchLocationFromEventName(eventName)
matchLocationFromEventName(eventName: string): string | number;
Parse the location from Event resource.
Parameter | |
---|---|
Name | Description |
eventName |
string
A fully-qualified path representing Event resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromOrganizationEventName(organizationEventName)
matchLocationFromOrganizationEventName(organizationEventName: string): string | number;
Parse the location from OrganizationEvent resource.
Parameter | |
---|---|
Name | Description |
organizationEventName |
string
A fully-qualified path representing OrganizationEvent resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromOrganizationImpactName(organizationImpactName)
matchLocationFromOrganizationImpactName(organizationImpactName: string): string | number;
Parse the location from OrganizationImpact resource.
Parameter | |
---|---|
Name | Description |
organizationImpactName |
string
A fully-qualified path representing OrganizationImpact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchOrganizationFromOrganizationEventName(organizationEventName)
matchOrganizationFromOrganizationEventName(organizationEventName: string): string | number;
Parse the organization from OrganizationEvent resource.
Parameter | |
---|---|
Name | Description |
organizationEventName |
string
A fully-qualified path representing OrganizationEvent resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchOrganizationFromOrganizationImpactName(organizationImpactName)
matchOrganizationFromOrganizationImpactName(organizationImpactName: string): string | number;
Parse the organization from OrganizationImpact resource.
Parameter | |
---|---|
Name | Description |
organizationImpactName |
string
A fully-qualified path representing OrganizationImpact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchOrganizationImpactFromOrganizationImpactName(organizationImpactName)
matchOrganizationImpactFromOrganizationImpactName(organizationImpactName: string): string | number;
Parse the organization_impact from OrganizationImpact resource.
Parameter | |
---|---|
Name | Description |
organizationImpactName |
string
A fully-qualified path representing OrganizationImpact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization_impact. |
matchProjectFromEventName(eventName)
matchProjectFromEventName(eventName: string): string | number;
Parse the project from Event resource.
Parameter | |
---|---|
Name | Description |
eventName |
string
A fully-qualified path representing Event resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
organizationEventPath(organization, location, event)
organizationEventPath(organization: string, location: string, event: string): string;
Return a fully-qualified organizationEvent resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
location |
string
|
event |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
organizationImpactPath(organization, location, organizationImpact)
organizationImpactPath(organization: string, location: string, organizationImpact: string): string;
Return a fully-qualified organizationImpact resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
location |
string
|
organizationImpact |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |