def testCreate(self): cluster = self.msgs.Cluster( location=self.zone_ref, defaultStorageType=self.msgs.Cluster.DefaultStorageTypeValueValuesEnum .STORAGE_TYPE_UNSPECIFIED, serveNodes=3) response = self.msgs.Operation() self.client.projects_instances_clusters.Create.Expect( request=self.msgs.BigtableadminProjectsInstancesClustersCreateRequest( cluster=cluster, clusterId=self.cluster_ref.Name(), parent=self.instance_ref.RelativeName()), response=response) self.assertEqual(clusters.Create(self.cluster_ref, cluster), response)
def Run(self, args): """This is what gets called when the user runs this command. Args: args: an argparse namespace. All the arguments that were provided to this command invocation. Returns: Some value that we want to have printed later. """ cluster_ref = args.CONCEPTS.cluster.Parse() operation = clusters.Create( cluster_ref, args.zone, serve_nodes=args.num_nodes) operation_ref = util.GetOperationRef(operation) if args.async_: log.CreatedResource( operation_ref, kind='bigtable cluster {0}'.format(cluster_ref.Name()), is_async=True) return return util.AwaitCluster( operation_ref, 'Creating bigtable cluster {0}'.format(cluster_ref.Name()))