Unified Maintenance service v1
Package
@google-cloud/maintenance-apiConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of MaintenanceClient.
| Parameters | |
|---|---|
| Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;descriptors
descriptors: Descriptors;innerApiCalls
innerApiCalls: {
[name: string]: Function;
};locationsClient
locationsClient: LocationsClient;maintenanceStub
maintenanceStub?: Promise<{
[name: string]: Function;
}>;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.
servicePath
static get servicePath(): string;The DNS address for this API service.
universeDomain
get universeDomain(): string;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. |
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);
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 |
|
getResourceMaintenance(request, options)
getResourceMaintenance(request?: protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest, options?: CallOptions): Promise<[
protos.google.cloud.maintenance.api.v1.IResourceMaintenance,
protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest | undefined,
{} | undefined
]>;Retrieve a single resource maintenance.
| Parameters | |
|---|---|
| Name | Description |
request |
IGetResourceMaintenanceRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.maintenance.api.v1.IResourceMaintenance,
protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest | 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. The resource name of the resource within a service.
*/
// const name = 'abc123'
// Imports the Api library
const {MaintenanceClient} = require('@google-cloud/maintenance-api').v1;
// Instantiates a client
const apiClient = new MaintenanceClient();
async function callGetResourceMaintenance() {
// Construct request
const request = {
name,
};
// Run request
const response = await apiClient.getResourceMaintenance(request);
console.log(response);
}
callGetResourceMaintenance();
getResourceMaintenance(request, options, callback)
getResourceMaintenance(request: protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest, options: CallOptions, callback: Callback<protos.google.cloud.maintenance.api.v1.IResourceMaintenance, protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetResourceMaintenanceRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.maintenance.api.v1.IResourceMaintenance, protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getResourceMaintenance(request, callback)
getResourceMaintenance(request: protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest, callback: Callback<protos.google.cloud.maintenance.api.v1.IResourceMaintenance, protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetResourceMaintenanceRequest
|
callback |
Callback<protos.google.cloud.maintenance.api.v1.IResourceMaintenance, protos.google.cloud.maintenance.api.v1.IGetResourceMaintenanceRequest | null | undefined, {} | null | 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. |
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
}
listResourceMaintenances(request, options)
listResourceMaintenances(request?: protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, options?: CallOptions): Promise<[
protos.google.cloud.maintenance.api.v1.IResourceMaintenance[],
protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest | null,
protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesResponse
]>;Retrieve a collection of resource maintenances.
| Parameters | |
|---|---|
| Name | Description |
request |
IListResourceMaintenancesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.maintenance.api.v1.IResourceMaintenance[],
protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest | null,
protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesResponse
]> |
{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 |
listResourceMaintenances(request, options, callback)
listResourceMaintenances(request: protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesResponse | null | undefined, protos.google.cloud.maintenance.api.v1.IResourceMaintenance>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListResourceMaintenancesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesResponse | null | undefined, protos.google.cloud.maintenance.api.v1.IResourceMaintenance>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listResourceMaintenances(request, callback)
listResourceMaintenances(request: protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, callback: PaginationCallback<protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesResponse | null | undefined, protos.google.cloud.maintenance.api.v1.IResourceMaintenance>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListResourceMaintenancesRequest
|
callback |
PaginationCallback<protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesResponse | null | undefined, protos.google.cloud.maintenance.api.v1.IResourceMaintenance>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listResourceMaintenancesAsync(request, options)
listResourceMaintenancesAsync(request?: protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.maintenance.api.v1.IResourceMaintenance>;Equivalent to listResourceMaintenances, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
IListResourceMaintenancesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.maintenance.api.v1.IResourceMaintenance> |
{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. The parent of the resource maintenance.
*/
// const parent = 'abc123'
/**
* The maximum number of resource maintenances to send per page.
*/
// const pageSize = 1234
/**
* The page token: If the next_page_token from a previous response
* is provided, this request will send the subsequent page.
*/
// const pageToken = 'abc123'
/**
* Filter the list as specified in https://google.aip.dev/160.
*/
// const filter = 'abc123'
/**
* Order results as specified in https://google.aip.dev/132.
*/
// const orderBy = 'abc123'
// Imports the Api library
const {MaintenanceClient} = require('@google-cloud/maintenance-api').v1;
// Instantiates a client
const apiClient = new MaintenanceClient();
async function callListResourceMaintenances() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apiClient.listResourceMaintenancesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListResourceMaintenances();
listResourceMaintenancesStream(request, options)
listResourceMaintenancesStream(request?: protos.google.cloud.maintenance.api.v1.IListResourceMaintenancesRequest, options?: CallOptions): Transform;Equivalent to listResourceMaintenances, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
IListResourceMaintenancesRequest
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 |
locationPath(project, location)
locationPath(project: string, location: string): string;Return a fully-qualified location resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;Parse the location from Location resource.
| Parameter | |
|---|---|
| Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromResourceMaintenanceName(resourceMaintenanceName)
matchLocationFromResourceMaintenanceName(resourceMaintenanceName: string): string | number;Parse the location from ResourceMaintenance resource.
| Parameter | |
|---|---|
| Name | Description |
resourceMaintenanceName |
string
A fully-qualified path representing ResourceMaintenance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;Parse the project from Location resource.
| Parameter | |
|---|---|
| Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;Parse the project from Project resource.
| Parameter | |
|---|---|
| Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromResourceMaintenanceName(resourceMaintenanceName)
matchProjectFromResourceMaintenanceName(resourceMaintenanceName: string): string | number;Parse the project from ResourceMaintenance resource.
| Parameter | |
|---|---|
| Name | Description |
resourceMaintenanceName |
string
A fully-qualified path representing ResourceMaintenance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchResourceMaintenanceFromResourceMaintenanceName(resourceMaintenanceName)
matchResourceMaintenanceFromResourceMaintenanceName(resourceMaintenanceName: string): string | number;Parse the resource_maintenance from ResourceMaintenance resource.
| Parameter | |
|---|---|
| Name | Description |
resourceMaintenanceName |
string
A fully-qualified path representing ResourceMaintenance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the resource_maintenance. |
projectPath(project)
projectPath(project: string): string;Return a fully-qualified project resource name string.
| Parameter | |
|---|---|
| Name | Description |
project |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
resourceMaintenancePath(project, location, resourceMaintenance)
resourceMaintenancePath(project: string, location: string, resourceMaintenance: string): string;Return a fully-qualified resourceMaintenance resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
resourceMaintenance |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
summarizeMaintenances(request, options)
summarizeMaintenances(request?: protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, options?: CallOptions): Promise<[
protos.google.cloud.maintenance.api.v1.IMaintenanceSummary[],
protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest | null,
protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesResponse
]>;Retrieves the statistics of a specific maintenance.
| Parameters | |
|---|---|
| Name | Description |
request |
ISummarizeMaintenancesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.maintenance.api.v1.IMaintenanceSummary[],
protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest | null,
protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesResponse
]> |
{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 |
summarizeMaintenances(request, options, callback)
summarizeMaintenances(request: protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesResponse | null | undefined, protos.google.cloud.maintenance.api.v1.IMaintenanceSummary>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISummarizeMaintenancesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesResponse | null | undefined, protos.google.cloud.maintenance.api.v1.IMaintenanceSummary>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
summarizeMaintenances(request, callback)
summarizeMaintenances(request: protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, callback: PaginationCallback<protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesResponse | null | undefined, protos.google.cloud.maintenance.api.v1.IMaintenanceSummary>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISummarizeMaintenancesRequest
|
callback |
PaginationCallback<protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesResponse | null | undefined, protos.google.cloud.maintenance.api.v1.IMaintenanceSummary>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
summarizeMaintenancesAsync(request, options)
summarizeMaintenancesAsync(request?: protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.maintenance.api.v1.IMaintenanceSummary>;Equivalent to summarizeMaintenances, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
ISummarizeMaintenancesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.maintenance.api.v1.IMaintenanceSummary> |
{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. The parent of the resource maintenance.
* eg. `projects/123/locations/*`
*/
// const parent = 'abc123'
/**
* The maximum number of resource maintenances to send per page. The default
* page size is 20 and the maximum is 1000.
*/
// const pageSize = 1234
/**
* The page token: If the next_page_token from a previous response
* is provided, this request will send the subsequent page.
*/
// const pageToken = 'abc123'
/**
* Filter the list as specified in https://google.aip.dev/160.
* Supported fields include:
* - `state`
* - `resource.location`
* - `resource.resourceName`
* - `resource.type`
* - `maintenance.maintenanceName`
* - `maintenanceStartTime`
* - `maintenanceCompleteTime`
* Examples:
* - `state="SCHEDULED"`
* - `resource.location="us-central1-c"`
* - `resource.resourceName=~"* /instance-20241212-211259"`
* - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
* - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
* - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
* maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
*/
// const filter = 'abc123'
/**
* Order results as specified in https://google.aip.dev/132.
*/
// const orderBy = 'abc123'
// Imports the Api library
const {MaintenanceClient} = require('@google-cloud/maintenance-api').v1;
// Instantiates a client
const apiClient = new MaintenanceClient();
async function callSummarizeMaintenances() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apiClient.summarizeMaintenancesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callSummarizeMaintenances();
summarizeMaintenancesStream(request, options)
summarizeMaintenancesStream(request?: protos.google.cloud.maintenance.api.v1.ISummarizeMaintenancesRequest, options?: CallOptions): Transform;Equivalent to summarizeMaintenances, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
ISummarizeMaintenancesRequest
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 |