Manages TPU nodes and other resources
TPU API v2alpha1 v2alpha1
Package
@google-cloud/tpuConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of TpuClient.
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.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;
};
operationsClient
operationsClient: gax.OperationsClient;
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.
tpuStub
tpuStub?: Promise<{
[name: string]: Function;
}>;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
acceleratorTypePath(project, location, acceleratorType)
acceleratorTypePath(project: string, location: string, acceleratorType: string): string;
Return a fully-qualified acceleratorType resource name string.
Name | Description |
project |
string
|
location |
string
|
acceleratorType |
string
|
Type | Description |
string | {string} Resource name string. |
checkCreateNodeProgress(name)
checkCreateNodeProgress(name: string): Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>>;
Check the status of the long running operation returned by createNode()
.
Name | Description |
name |
string
The operation name that will be passed. |
Type | Description |
Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 resource name.
*/
// const parent = 'abc123'
/**
* The unqualified resource name.
*/
// const nodeId = 'abc123'
/**
* Required. The node.
*/
// const node = {}
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callCreateNode() {
// Construct request
const request = {
parent,
node,
};
// Run request
const [operation] = await tpuClient.createNode(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateNode();
checkDeleteNodeProgress(name)
checkDeleteNodeProgress(name: string): Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>>;
Check the status of the long running operation returned by deleteNode()
.
Name | Description |
name |
string
The operation name that will be passed. |
Type | Description |
Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callDeleteNode() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await tpuClient.deleteNode(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteNode();
checkStartNodeProgress(name)
checkStartNodeProgress(name: string): Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>>;
Check the status of the long running operation returned by startNode()
.
Name | Description |
name |
string
The operation name that will be passed. |
Type | Description |
Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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.
*/
/**
* The resource name.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callStartNode() {
// Construct request
const request = {
};
// Run request
const [operation] = await tpuClient.startNode(request);
const [response] = await operation.promise();
console.log(response);
}
callStartNode();
checkStopNodeProgress(name)
checkStopNodeProgress(name: string): Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>>;
Check the status of the long running operation returned by stopNode()
.
Name | Description |
name |
string
The operation name that will be passed. |
Type | Description |
Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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.
*/
/**
* The resource name.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callStopNode() {
// Construct request
const request = {
};
// Run request
const [operation] = await tpuClient.stopNode(request);
const [response] = await operation.promise();
console.log(response);
}
callStopNode();
checkUpdateNodeProgress(name)
checkUpdateNodeProgress(name: string): Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>>;
Check the status of the long running operation returned by updateNode()
.
Name | Description |
name |
string
The operation name that will be passed. |
Type | Description |
Promise<LROperation<protos.google.cloud.tpu.v2alpha1.Node, protos.google.cloud.tpu.v2alpha1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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. Mask of fields from Node Tpu.Node to update.
* Supported fields: None.
*/
// const updateMask = {}
/**
* Required. The node. Only fields specified in update_mask are updated.
*/
// const node = {}
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callUpdateNode() {
// Construct request
const request = {
updateMask,
node,
};
// Run request
const [operation] = await tpuClient.updateNode(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateNode();
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.
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
createNode(request, options)
createNode(request?: protos.google.cloud.tpu.v2alpha1.ICreateNodeRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Creates a node.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.ICreateNodeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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 resource name.
*/
// const parent = 'abc123'
/**
* The unqualified resource name.
*/
// const nodeId = 'abc123'
/**
* Required. The node.
*/
// const node = {}
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callCreateNode() {
// Construct request
const request = {
parent,
node,
};
// Run request
const [operation] = await tpuClient.createNode(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateNode();
createNode(request, options, callback)
createNode(request: protos.google.cloud.tpu.v2alpha1.ICreateNodeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.ICreateNodeRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
createNode(request, callback)
createNode(request: protos.google.cloud.tpu.v2alpha1.ICreateNodeRequest, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.ICreateNodeRequest
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteNode(request, options)
deleteNode(request?: protos.google.cloud.tpu.v2alpha1.IDeleteNodeRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Deletes a node.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IDeleteNodeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callDeleteNode() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await tpuClient.deleteNode(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteNode();
deleteNode(request, options, callback)
deleteNode(request: protos.google.cloud.tpu.v2alpha1.IDeleteNodeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IDeleteNodeRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteNode(request, callback)
deleteNode(request: protos.google.cloud.tpu.v2alpha1.IDeleteNodeRequest, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IDeleteNodeRequest
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
generateServiceIdentity(request, options)
generateServiceIdentity(request?: protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest, options?: CallOptions): Promise<[
protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityResponse,
(protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest | undefined),
{} | undefined
]>;
Generates the Cloud TPU service identity for the project.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityResponse, (protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [GenerateServiceIdentityResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 resource name.
*/
// const parent = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callGenerateServiceIdentity() {
// Construct request
const request = {
parent,
};
// Run request
const response = await tpuClient.generateServiceIdentity(request);
console.log(response);
}
callGenerateServiceIdentity();
generateServiceIdentity(request, options, callback)
generateServiceIdentity(request: protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest, options: CallOptions, callback: Callback<protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityResponse, protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityResponse, protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
generateServiceIdentity(request, callback)
generateServiceIdentity(request: protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest, callback: Callback<protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityResponse, protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityResponse, protos.google.cloud.tpu.v2alpha1.IGenerateServiceIdentityRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getAcceleratorType(request, options)
getAcceleratorType(request?: protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest, options?: CallOptions): Promise<[
protos.google.cloud.tpu.v2alpha1.IAcceleratorType,
protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest | undefined,
{} | undefined
]>;
Gets AcceleratorType.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.tpu.v2alpha1.IAcceleratorType, protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [AcceleratorType]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callGetAcceleratorType() {
// Construct request
const request = {
name,
};
// Run request
const response = await tpuClient.getAcceleratorType(request);
console.log(response);
}
callGetAcceleratorType();
getAcceleratorType(request, options, callback)
getAcceleratorType(request: protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest, options: CallOptions, callback: Callback<protos.google.cloud.tpu.v2alpha1.IAcceleratorType, protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.IAcceleratorType, protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getAcceleratorType(request, callback)
getAcceleratorType(request: protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest, callback: Callback<protos.google.cloud.tpu.v2alpha1.IAcceleratorType, protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.IAcceleratorType, protos.google.cloud.tpu.v2alpha1.IGetAcceleratorTypeRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getGuestAttributes(request, options)
getGuestAttributes(request?: protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest, options?: CallOptions): Promise<[
protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesResponse,
protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest | undefined,
{} | undefined
]>;
Retrieves the guest attributes for the node.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesResponse, protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [GetGuestAttributesResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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.
*/
// const name = 'abc123'
/**
* The guest attributes path to be queried.
*/
// const queryPath = 'abc123'
/**
* The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
* returned.
*/
// const workerIds = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callGetGuestAttributes() {
// Construct request
const request = {
name,
};
// Run request
const response = await tpuClient.getGuestAttributes(request);
console.log(response);
}
callGetGuestAttributes();
getGuestAttributes(request, options, callback)
getGuestAttributes(request: protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest, options: CallOptions, callback: Callback<protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesResponse, protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesResponse, protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getGuestAttributes(request, callback)
getGuestAttributes(request: protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest, callback: Callback<protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesResponse, protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesResponse, protos.google.cloud.tpu.v2alpha1.IGetGuestAttributesRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getNode(request, options)
getNode(request?: protos.google.cloud.tpu.v2alpha1.IGetNodeRequest, options?: CallOptions): Promise<[
protos.google.cloud.tpu.v2alpha1.INode,
protos.google.cloud.tpu.v2alpha1.IGetNodeRequest | undefined,
{} | undefined
]>;
Gets the details of a node.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetNodeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IGetNodeRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Node]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callGetNode() {
// Construct request
const request = {
name,
};
// Run request
const response = await tpuClient.getNode(request);
console.log(response);
}
callGetNode();
getNode(request, options, callback)
getNode(request: protos.google.cloud.tpu.v2alpha1.IGetNodeRequest, options: CallOptions, callback: Callback<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IGetNodeRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetNodeRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IGetNodeRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getNode(request, callback)
getNode(request: protos.google.cloud.tpu.v2alpha1.IGetNodeRequest, callback: Callback<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IGetNodeRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetNodeRequest
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IGetNodeRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Type | Description |
void |
getRuntimeVersion(request, options)
getRuntimeVersion(request?: protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest, options?: CallOptions): Promise<[
protos.google.cloud.tpu.v2alpha1.IRuntimeVersion,
protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest | undefined,
{} | undefined
]>;
Gets a runtime version.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.tpu.v2alpha1.IRuntimeVersion, protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [RuntimeVersion]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callGetRuntimeVersion() {
// Construct request
const request = {
name,
};
// Run request
const response = await tpuClient.getRuntimeVersion(request);
console.log(response);
}
callGetRuntimeVersion();
getRuntimeVersion(request, options, callback)
getRuntimeVersion(request: protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest, options: CallOptions, callback: Callback<protos.google.cloud.tpu.v2alpha1.IRuntimeVersion, protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.IRuntimeVersion, protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getRuntimeVersion(request, callback)
getRuntimeVersion(request: protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest, callback: Callback<protos.google.cloud.tpu.v2alpha1.IRuntimeVersion, protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest
|
callback |
Callback<protos.google.cloud.tpu.v2alpha1.IRuntimeVersion, protos.google.cloud.tpu.v2alpha1.IGetRuntimeVersionRequest | null | undefined, {} | null | undefined>
|
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.
Type | Description |
Promise<{ [name: string]: Function; }> | {Promise} A promise that resolves to an authenticated service stub. |
listAcceleratorTypes(request, options)
listAcceleratorTypes(request?: protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, options?: CallOptions): Promise<[
protos.google.cloud.tpu.v2alpha1.IAcceleratorType[],
protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest | null,
protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesResponse
]>;
Lists accelerator types supported by this API.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.tpu.v2alpha1.IAcceleratorType[], protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest | null, protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [AcceleratorType]. 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 |
listAcceleratorTypes(request, options, callback)
listAcceleratorTypes(request: protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.IAcceleratorType>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.IAcceleratorType>
|
Type | Description |
void |
listAcceleratorTypes(request, callback)
listAcceleratorTypes(request: protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, callback: PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.IAcceleratorType>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest
|
callback |
PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.IAcceleratorType>
|
Type | Description |
void |
listAcceleratorTypesAsync(request, options)
listAcceleratorTypesAsync(request?: protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.tpu.v2alpha1.IAcceleratorType>;
Equivalent to listAcceleratorTypes
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.tpu.v2alpha1.IAcceleratorType> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [AcceleratorType]. 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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 resource name.
*/
// const parent = 'abc123'
/**
* The maximum number of items to return.
*/
// const pageSize = 1234
/**
* The next_page_token value returned from a previous List request, if any.
*/
// const pageToken = 'abc123'
/**
* List filter.
*/
// const filter = 'abc123'
/**
* Sort results.
*/
// const orderBy = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callListAcceleratorTypes() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await tpuClient.listAcceleratorTypesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAcceleratorTypes();
listAcceleratorTypesStream(request, options)
listAcceleratorTypesStream(request?: protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListAcceleratorTypesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [AcceleratorType] 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 |
listNodes(request, options)
listNodes(request?: protos.google.cloud.tpu.v2alpha1.IListNodesRequest, options?: CallOptions): Promise<[
protos.google.cloud.tpu.v2alpha1.INode[],
protos.google.cloud.tpu.v2alpha1.IListNodesRequest | null,
protos.google.cloud.tpu.v2alpha1.IListNodesResponse
]>;
Lists nodes.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListNodesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.tpu.v2alpha1.INode[], protos.google.cloud.tpu.v2alpha1.IListNodesRequest | null, protos.google.cloud.tpu.v2alpha1.IListNodesResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Node]. 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 |
listNodes(request, options, callback)
listNodes(request: protos.google.cloud.tpu.v2alpha1.IListNodesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListNodesRequest, protos.google.cloud.tpu.v2alpha1.IListNodesResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.INode>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListNodesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListNodesRequest, protos.google.cloud.tpu.v2alpha1.IListNodesResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.INode>
|
Type | Description |
void |
listNodes(request, callback)
listNodes(request: protos.google.cloud.tpu.v2alpha1.IListNodesRequest, callback: PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListNodesRequest, protos.google.cloud.tpu.v2alpha1.IListNodesResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.INode>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListNodesRequest
|
callback |
PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListNodesRequest, protos.google.cloud.tpu.v2alpha1.IListNodesResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.INode>
|
Type | Description |
void |
listNodesAsync(request, options)
listNodesAsync(request?: protos.google.cloud.tpu.v2alpha1.IListNodesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.tpu.v2alpha1.INode>;
Equivalent to listNodes
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListNodesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.tpu.v2alpha1.INode> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Node]. 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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 resource name.
*/
// const parent = 'abc123'
/**
* The maximum number of items to return.
*/
// const pageSize = 1234
/**
* The next_page_token value returned from a previous List request, if any.
*/
// const pageToken = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callListNodes() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await tpuClient.listNodesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListNodes();
listNodesStream(request, options)
listNodesStream(request?: protos.google.cloud.tpu.v2alpha1.IListNodesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListNodesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Node] 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 |
listRuntimeVersions(request, options)
listRuntimeVersions(request?: protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, options?: CallOptions): Promise<[
protos.google.cloud.tpu.v2alpha1.IRuntimeVersion[],
protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest | null,
protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsResponse
]>;
Lists runtime versions supported by this API.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.tpu.v2alpha1.IRuntimeVersion[], protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest | null, protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [RuntimeVersion]. 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 |
listRuntimeVersions(request, options, callback)
listRuntimeVersions(request: protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.IRuntimeVersion>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.IRuntimeVersion>
|
Type | Description |
void |
listRuntimeVersions(request, callback)
listRuntimeVersions(request: protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, callback: PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.IRuntimeVersion>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest
|
callback |
PaginationCallback<protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsResponse | null | undefined, protos.google.cloud.tpu.v2alpha1.IRuntimeVersion>
|
Type | Description |
void |
listRuntimeVersionsAsync(request, options)
listRuntimeVersionsAsync(request?: protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.tpu.v2alpha1.IRuntimeVersion>;
Equivalent to listRuntimeVersions
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.tpu.v2alpha1.IRuntimeVersion> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [RuntimeVersion]. 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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 resource name.
*/
// const parent = 'abc123'
/**
* The maximum number of items to return.
*/
// const pageSize = 1234
/**
* The next_page_token value returned from a previous List request, if any.
*/
// const pageToken = 'abc123'
/**
* List filter.
*/
// const filter = 'abc123'
/**
* Sort results.
*/
// const orderBy = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callListRuntimeVersions() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await tpuClient.listRuntimeVersionsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListRuntimeVersions();
listRuntimeVersionsStream(request, options)
listRuntimeVersionsStream(request?: protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IListRuntimeVersionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [RuntimeVersion] 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.
Name | Description |
project |
string
|
location |
string
|
Type | Description |
string | {string} Resource name string. |
matchAcceleratorTypeFromAcceleratorTypeName(acceleratorTypeName)
matchAcceleratorTypeFromAcceleratorTypeName(acceleratorTypeName: string): string | number;
Parse the accelerator_type from AcceleratorType resource.
Name | Description |
acceleratorTypeName |
string
A fully-qualified path representing AcceleratorType resource. |
Type | Description |
string | number | {string} A string representing the accelerator_type. |
matchLocationFromAcceleratorTypeName(acceleratorTypeName)
matchLocationFromAcceleratorTypeName(acceleratorTypeName: string): string | number;
Parse the location from AcceleratorType resource.
Name | Description |
acceleratorTypeName |
string
A fully-qualified path representing AcceleratorType resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;
Parse the location from Location resource.
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromNodeName(nodeName)
matchLocationFromNodeName(nodeName: string): string | number;
Parse the location from Node resource.
Name | Description |
nodeName |
string
A fully-qualified path representing Node resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromRuntimeVersionName(runtimeVersionName)
matchLocationFromRuntimeVersionName(runtimeVersionName: string): string | number;
Parse the location from RuntimeVersion resource.
Name | Description |
runtimeVersionName |
string
A fully-qualified path representing RuntimeVersion resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchNodeFromNodeName(nodeName)
matchNodeFromNodeName(nodeName: string): string | number;
Parse the node from Node resource.
Name | Description |
nodeName |
string
A fully-qualified path representing Node resource. |
Type | Description |
string | number | {string} A string representing the node. |
matchProjectFromAcceleratorTypeName(acceleratorTypeName)
matchProjectFromAcceleratorTypeName(acceleratorTypeName: string): string | number;
Parse the project from AcceleratorType resource.
Name | Description |
acceleratorTypeName |
string
A fully-qualified path representing AcceleratorType resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;
Parse the project from Location resource.
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromNodeName(nodeName)
matchProjectFromNodeName(nodeName: string): string | number;
Parse the project from Node resource.
Name | Description |
nodeName |
string
A fully-qualified path representing Node resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromRuntimeVersionName(runtimeVersionName)
matchProjectFromRuntimeVersionName(runtimeVersionName: string): string | number;
Parse the project from RuntimeVersion resource.
Name | Description |
runtimeVersionName |
string
A fully-qualified path representing RuntimeVersion resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchRuntimeVersionFromRuntimeVersionName(runtimeVersionName)
matchRuntimeVersionFromRuntimeVersionName(runtimeVersionName: string): string | number;
Parse the runtime_version from RuntimeVersion resource.
Name | Description |
runtimeVersionName |
string
A fully-qualified path representing RuntimeVersion resource. |
Type | Description |
string | number | {string} A string representing the runtime_version. |
nodePath(project, location, node)
nodePath(project: string, location: string, node: string): string;
Return a fully-qualified node resource name string.
Name | Description |
project |
string
|
location |
string
|
node |
string
|
Type | Description |
string | {string} Resource name string. |
runtimeVersionPath(project, location, runtimeVersion)
runtimeVersionPath(project: string, location: string, runtimeVersion: string): string;
Return a fully-qualified runtimeVersion resource name string.
Name | Description |
project |
string
|
location |
string
|
runtimeVersion |
string
|
Type | Description |
string | {string} Resource name string. |
startNode(request, options)
startNode(request?: protos.google.cloud.tpu.v2alpha1.IStartNodeRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Starts a node.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IStartNodeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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.
*/
/**
* The resource name.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callStartNode() {
// Construct request
const request = {
};
// Run request
const [operation] = await tpuClient.startNode(request);
const [response] = await operation.promise();
console.log(response);
}
callStartNode();
startNode(request, options, callback)
startNode(request: protos.google.cloud.tpu.v2alpha1.IStartNodeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IStartNodeRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
startNode(request, callback)
startNode(request: protos.google.cloud.tpu.v2alpha1.IStartNodeRequest, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IStartNodeRequest
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
stopNode(request, options)
stopNode(request?: protos.google.cloud.tpu.v2alpha1.IStopNodeRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Stops a node. This operation is only available with single TPU nodes.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IStopNodeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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.
*/
/**
* The resource name.
*/
// const name = 'abc123'
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callStopNode() {
// Construct request
const request = {
};
// Run request
const [operation] = await tpuClient.stopNode(request);
const [response] = await operation.promise();
console.log(response);
}
callStopNode();
stopNode(request, options, callback)
stopNode(request: protos.google.cloud.tpu.v2alpha1.IStopNodeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IStopNodeRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
stopNode(request, callback)
stopNode(request: protos.google.cloud.tpu.v2alpha1.IStopNodeRequest, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IStopNodeRequest
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateNode(request, options)
updateNode(request?: protos.google.cloud.tpu.v2alpha1.IUpdateNodeRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Updates the configurations of a node.
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IUpdateNodeRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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. Mask of fields from Node Tpu.Node to update.
* Supported fields: None.
*/
// const updateMask = {}
/**
* Required. The node. Only fields specified in update_mask are updated.
*/
// const node = {}
// Imports the Tpu library
const {TpuClient} = require('@google-cloud/tpu').v2alpha1;
// Instantiates a client
const tpuClient = new TpuClient();
async function callUpdateNode() {
// Construct request
const request = {
updateMask,
node,
};
// Run request
const [operation] = await tpuClient.updateNode(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateNode();
updateNode(request, options, callback)
updateNode(request: protos.google.cloud.tpu.v2alpha1.IUpdateNodeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IUpdateNodeRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateNode(request, callback)
updateNode(request: protos.google.cloud.tpu.v2alpha1.IUpdateNodeRequest, callback: Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.tpu.v2alpha1.IUpdateNodeRequest
|
callback |
Callback<LROperation<protos.google.cloud.tpu.v2alpha1.INode, protos.google.cloud.tpu.v2alpha1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Type | Description |
void |