示例#1
0
 def Run(self, args):
   """Runs the describe command."""
   location = resource_args.ParseAzureNodePoolResourceArg(args).locationsId
   with endpoint_util.GkemulticloudEndpointOverride(location):
     nodepool_ref = resource_args.ParseAzureNodePoolResourceArg(args)
     client = api_util.NodePoolsClient()
     return client.Get(nodepool_ref)
 def Run(self, args):
     """Runs the list command."""
     cluster_ref = args.CONCEPTS.cluster.Parse()
     with endpoint_util.GkemulticloudEndpointOverride(
             cluster_ref.locationsId):
         api_client = api_util.NodePoolsClient()
         return api_client.List(cluster_ref,
                                page_size=args.page_size,
                                limit=args.limit)
 def Run(self, args):
     """Runs the delete command."""
     location = resource_args.ParseAzureNodePoolResourceArg(
         args).locationsId
     with endpoint_util.GkemulticloudEndpointOverride(location):
         node_pool_ref = resource_args.ParseAzureNodePoolResourceArg(args)
         node_pool_client = api_util.NodePoolsClient()
         message = command_util.NodePoolMessage(
             node_pool_ref.azureNodePoolsId,
             cluster=node_pool_ref.azureClustersId)
         return command_util.Delete(resource_ref=node_pool_ref,
                                    resource_client=node_pool_client,
                                    message=message,
                                    args=args,
                                    kind=constants.AZURE_NODEPOOL_KIND)
示例#4
0
 def Run(self, args):
     """Runs the get-credentials command."""
     with endpoint_util.GkemulticloudEndpointOverride(
             resource_args.ParseAzureClusterResourceArg(args).locationsId,
             self.ReleaseTrack()):
         cluster_ref = resource_args.ParseAzureClusterResourceArg(args)
         client = api_util.ClustersClient()
         if not args.private_endpoint:
             kubeconfig.CheckClusterHasNodePools(api_util.NodePoolsClient(),
                                                 cluster_ref)
         resp = client.Get(cluster_ref)
         kubeconfig.ValidateClusterVersion(resp)
         context = kubeconfig.GenerateContext('azure',
                                              cluster_ref.projectsId,
                                              cluster_ref.locationsId,
                                              cluster_ref.azureClustersId)
         cmd_args = kubeconfig.GenerateAuthProviderCmdArgs(
             'azure', cluster_ref.azureClustersId, cluster_ref.locationsId,
             cluster_ref.projectsId)
         kubeconfig.GenerateKubeconfig(resp, context,
                                       args.auth_provider_cmd_path,
                                       cmd_args, args.private_endpoint)