-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: TPU v2alpha1 public protos (#43)
Committer: @rosbo PiperOrigin-RevId: 403400668 Source-Link: googleapis/googleapis@8f48b97 Source-Link: googleapis/googleapis-gen@f966fd0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjk2NmZkMDJiZDBkMjQ4ZTlhZGVmZmUzYmIyZGFhNTNiZjQ0YTI1MiJ9
- Loading branch information
1 parent
a3ce9b1
commit 6207f89
Showing
36 changed files
with
21,444 additions
and
8 deletions.
There are no files selected for viewing
782 changes: 782 additions & 0 deletions
782
packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
packages/google-cloud-tpu/samples/generated/v1/tpu.create_node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(parent, node) { | ||
// [START tpu_v1_generated_Tpu_CreateNode_async] | ||
/** | ||
* 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').v1; | ||
|
||
// Instantiates a client | ||
const tpuClient = new TpuClient(); | ||
|
||
async function createNode() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
node, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await tpuClient.createNode(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
createNode(); | ||
// [END tpu_v1_generated_Tpu_CreateNode_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
53 changes: 53 additions & 0 deletions
53
packages/google-cloud-tpu/samples/generated/v1/tpu.delete_node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(name) { | ||
// [START tpu_v1_generated_Tpu_DeleteNode_async] | ||
/** | ||
* 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').v1; | ||
|
||
// Instantiates a client | ||
const tpuClient = new TpuClient(); | ||
|
||
async function deleteNode() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await tpuClient.deleteNode(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
deleteNode(); | ||
// [END tpu_v1_generated_Tpu_DeleteNode_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
52 changes: 52 additions & 0 deletions
52
packages/google-cloud-tpu/samples/generated/v1/tpu.get_accelerator_type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(name) { | ||
// [START tpu_v1_generated_Tpu_GetAcceleratorType_async] | ||
/** | ||
* 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').v1; | ||
|
||
// Instantiates a client | ||
const tpuClient = new TpuClient(); | ||
|
||
async function getAcceleratorType() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await tpuClient.getAcceleratorType(request); | ||
console.log(response); | ||
} | ||
|
||
getAcceleratorType(); | ||
// [END tpu_v1_generated_Tpu_GetAcceleratorType_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
52 changes: 52 additions & 0 deletions
52
packages/google-cloud-tpu/samples/generated/v1/tpu.get_node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(name) { | ||
// [START tpu_v1_generated_Tpu_GetNode_async] | ||
/** | ||
* 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').v1; | ||
|
||
// Instantiates a client | ||
const tpuClient = new TpuClient(); | ||
|
||
async function getNode() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await tpuClient.getNode(request); | ||
console.log(response); | ||
} | ||
|
||
getNode(); | ||
// [END tpu_v1_generated_Tpu_GetNode_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
52 changes: 52 additions & 0 deletions
52
packages/google-cloud-tpu/samples/generated/v1/tpu.get_tensor_flow_version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(name) { | ||
// [START tpu_v1_generated_Tpu_GetTensorFlowVersion_async] | ||
/** | ||
* 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').v1; | ||
|
||
// Instantiates a client | ||
const tpuClient = new TpuClient(); | ||
|
||
async function getTensorFlowVersion() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await tpuClient.getTensorFlowVersion(request); | ||
console.log(response); | ||
} | ||
|
||
getTensorFlowVersion(); | ||
// [END tpu_v1_generated_Tpu_GetTensorFlowVersion_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
70 changes: 70 additions & 0 deletions
70
packages/google-cloud-tpu/samples/generated/v1/tpu.list_accelerator_types.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(parent) { | ||
// [START tpu_v1_generated_Tpu_ListAcceleratorTypes_async] | ||
/** | ||
* 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').v1; | ||
|
||
// Instantiates a client | ||
const tpuClient = new TpuClient(); | ||
|
||
async function listAcceleratorTypes() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
}; | ||
|
||
// Run request | ||
const iterable = await tpuClient.listAcceleratorTypesAsync(request); | ||
for await (const response of iterable) { | ||
console.log(response); | ||
} | ||
} | ||
|
||
listAcceleratorTypes(); | ||
// [END tpu_v1_generated_Tpu_ListAcceleratorTypes_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.