MCPcopy Create free account
hub / github.com/apple/axlearn / _node_pool_resource

Function _node_pool_resource

axlearn/cloud/gcp/node_pool.py:234–249  ·  view source on GitHub ↗

Builds gcloud v1 node pool API resource. Args: credentials: Gcloud credentials used by googleapiclient.discovery. Returns: discovery.Resource object for the v1 node pool API.

(credentials: Credentials)

Source from the content-addressed store, hash-verified

232
233
234def _node_pool_resource(credentials: Credentials) -> discovery.Resource:
235 """Builds gcloud v1 node pool API resource.
236
237 Args:
238 credentials: Gcloud credentials used by googleapiclient.discovery.
239
240 Returns:
241 discovery.Resource object for the v1 node pool API.
242 """
243 return (
244 discovery.build("container", "v1", credentials=credentials, cache_discovery=False)
245 .projects()
246 .locations()
247 .clusters()
248 .nodePools()
249 )
250
251
252def _create_node_pool(resource: discovery.Resource, *, parent: str, body: Any):

Callers 4

delete_node_poolFunction · 0.85
create_node_poolFunction · 0.85
get_node_pool_statusFunction · 0.85

Calls 1

buildMethod · 0.45

Tested by

no test coverage detected