diff --git a/HypercomputeCluster/.OwlBot.yaml b/HypercomputeCluster/.OwlBot.yaml index 4c9d57cfea6f..d5632e8a9c8b 100644 --- a/HypercomputeCluster/.OwlBot.yaml +++ b/HypercomputeCluster/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/hypercomputecluster/(v1beta)/.*-php/(.*) + - source: /google/cloud/hypercomputecluster/(v1|v1beta)/.*-php/(.*) dest: /owl-bot-staging/HypercomputeCluster/$1/$2 api-name: HypercomputeCluster diff --git a/HypercomputeCluster/metadata/V1/HypercomputeCluster.php b/HypercomputeCluster/metadata/V1/HypercomputeCluster.php new file mode 100644 index 000000000000..0bbafa474bbe --- /dev/null +++ b/HypercomputeCluster/metadata/V1/HypercomputeCluster.php @@ -0,0 +1,35 @@ +internalAddGeneratedFile( + "\x0A\xF5[\x0A>google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto\x12#google.cloud.hypercomputecluster.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x1Bgoogle/api/field_info.proto\x1A\x19google/api/resource.proto\x1A\x0A\x08clusters\x18\x01 \x03(\x0B2,.google.cloud.hypercomputecluster.v1.Cluster\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"U\x0A\x11GetClusterRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*hypercomputecluster.googleapis.com/Cluster\"\xD8\x01\x0A\x14CreateClusterRequest\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x12*hypercomputecluster.googleapis.com/Cluster\x12\x17\x0A\x0Acluster_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12B\x0A\x07cluster\x18\x03 \x01(\x0B2,.google.cloud.hypercomputecluster.v1.ClusterB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xB1\x01\x0A\x14UpdateClusterRequest\x12B\x0A\x07cluster\x18\x02 \x01(\x0B2,.google.cloud.hypercomputecluster.v1.ClusterB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\x12\x1F\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"y\x0A\x14DeleteClusterRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*hypercomputecluster.googleapis.com/Cluster\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xB9\x01\x0A\x0FNetworkResource\x12H\x0A\x07network\x18\x03 \x01(\x0B25.google.cloud.hypercomputecluster.v1.NetworkReferenceH\x00\x12O\x0A\x06config\x18\x02 \x01(\x0B2:.google.cloud.hypercomputecluster.v1.NetworkResourceConfigB\x03\xE0A\x05B\x0B\x0A\x09reference\"\x8A\x01\x0A\x10NetworkReference\x127\x0A\x07network\x18\x01 \x01(\x09B&\xE0A\x03\xFAA \x0A\x1Ecompute.googleapis.com/Network\x12=\x0A\x0Asubnetwork\x18\x02 \x01(\x09B)\xE0A\x03\xFAA#\x0A!compute.googleapis.com/Subnetwork\"\xD7\x01\x0A\x15NetworkResourceConfig\x12T\x0A\x0Bnew_network\x18\x03 \x01(\x0B25.google.cloud.hypercomputecluster.v1.NewNetworkConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12^\x0A\x10existing_network\x18\x04 \x01(\x0B2:.google.cloud.hypercomputecluster.v1.ExistingNetworkConfigB\x06\xE0A\x01\xE0A\x05H\x00B\x08\x0A\x06config\"k\x0A\x10NewNetworkConfig\x12:\x0A\x07network\x18\x01 \x01(\x09B)\xE0A\x02\xE0A\x05\xFAA \x0A\x1Ecompute.googleapis.com/Network\x12\x1B\x0A\x0Bdescription\x18\x02 \x01(\x09B\x06\xE0A\x01\xE0A\x05\"\x95\x01\x0A\x15ExistingNetworkConfig\x12:\x0A\x07network\x18\x01 \x01(\x09B)\xE0A\x02\xE0A\x05\xFAA \x0A\x1Ecompute.googleapis.com/Network\x12@\x0A\x0Asubnetwork\x18\x02 \x01(\x09B,\xE0A\x02\xE0A\x05\xFAA#\x0A!compute.googleapis.com/Subnetwork\"\xD0\x02\x0A\x0FStorageResource\x12L\x0A\x09filestore\x18\x01 \x01(\x0B27.google.cloud.hypercomputecluster.v1.FilestoreReferenceH\x00\x12F\x0A\x06bucket\x18\x02 \x01(\x0B24.google.cloud.hypercomputecluster.v1.BucketReferenceH\x00\x12F\x0A\x06lustre\x18\x03 \x01(\x0B24.google.cloud.hypercomputecluster.v1.LustreReferenceH\x00\x12R\x0A\x06config\x18\x04 \x01(\x0B2:.google.cloud.hypercomputecluster.v1.StorageResourceConfigB\x06\xE0A\x02\xE0A\x05B\x0B\x0A\x09reference\"Q\x0A\x12FilestoreReference\x12;\x0A\x09filestore\x18\x01 \x01(\x09B(\xE0A\x03\xFAA\"\x0A file.googleapis.com/FileInstance\"H\x0A\x0FBucketReference\x125\x0A\x06bucket\x18\x01 \x01(\x09B%\xE0A\x03\xFAA\x1F\x0A\x1Dstorage.googleapis.com/Bucket\"I\x0A\x0FLustreReference\x126\x0A\x06lustre\x18\x01 \x01(\x09B&\xE0A\x03\xFAA \x0A\x1Elustre.googleapis.com/Instance\"\xC3\x04\x0A\x15StorageResourceConfig\x12X\x0A\x0Dnew_filestore\x18\x01 \x01(\x0B27.google.cloud.hypercomputecluster.v1.NewFilestoreConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12b\x0A\x12existing_filestore\x18\x02 \x01(\x0B2<.google.cloud.hypercomputecluster.v1.ExistingFilestoreConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12R\x0A\x0Anew_bucket\x18\x03 \x01(\x0B24.google.cloud.hypercomputecluster.v1.NewBucketConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12\\\x0A\x0Fexisting_bucket\x18\x04 \x01(\x0B29.google.cloud.hypercomputecluster.v1.ExistingBucketConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12R\x0A\x0Anew_lustre\x18\x05 \x01(\x0B24.google.cloud.hypercomputecluster.v1.NewLustreConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12\\\x0A\x0Fexisting_lustre\x18\x06 \x01(\x0B29.google.cloud.hypercomputecluster.v1.ExistingLustreConfigB\x06\xE0A\x01\xE0A\x05H\x00B\x08\x0A\x06config\"\xEB\x03\x0A\x12NewFilestoreConfig\x12>\x0A\x09filestore\x18\x01 \x01(\x09B+\xE0A\x02\xE0A\x05\xFAA\"\x0A file.googleapis.com/FileInstance\x12\x1B\x0A\x0Bdescription\x18\x04 \x01(\x09B\x06\xE0A\x01\xE0A\x05\x12Q\x0A\x0Bfile_shares\x18\x02 \x03(\x0B24.google.cloud.hypercomputecluster.v1.FileShareConfigB\x06\xE0A\x02\xE0A\x05\x12R\x0A\x04tier\x18\x03 \x01(\x0E2<.google.cloud.hypercomputecluster.v1.NewFilestoreConfig.TierB\x06\xE0A\x02\xE0A\x05\x12]\x0A\x08protocol\x18\x05 \x01(\x0E2@.google.cloud.hypercomputecluster.v1.NewFilestoreConfig.ProtocolB\x09\xE0A\x01\xE0A\x01\xE0A\x05\"5\x0A\x04Tier\x12\x14\x0A\x10TIER_UNSPECIFIED\x10\x00\x12\x09\x0A\x05ZONAL\x10\x04\x12\x0C\x0A\x08REGIONAL\x10\x06\";\x0A\x08Protocol\x12\x18\x0A\x14PROTOCOL_UNSPECIFIED\x10\x00\x12\x09\x0A\x05NFSV3\x10\x01\x12\x0A\x0A\x06NFSV41\x10\x02\"D\x0A\x0FFileShareConfig\x12\x18\x0A\x0Bcapacity_gb\x18\x01 \x01(\x03B\x03\xE0A\x02\x12\x17\x0A\x0Afile_share\x18\x02 \x01(\x09B\x03\xE0A\x02\"Y\x0A\x17ExistingFilestoreConfig\x12>\x0A\x09filestore\x18\x01 \x01(\x09B+\xE0A\x02\xE0A\x05\xFAA\"\x0A file.googleapis.com/FileInstance\"\xE2\x03\x0A\x0FNewBucketConfig\x12T\x0A\x09autoclass\x18\x02 \x01(\x0B27.google.cloud.hypercomputecluster.v1.GcsAutoclassConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12b\x0A\x0Dstorage_class\x18\x03 \x01(\x0E2A.google.cloud.hypercomputecluster.v1.NewBucketConfig.StorageClassB\x06\xE0A\x01\xE0A\x05H\x00\x128\x0A\x06bucket\x18\x01 \x01(\x09B(\xE0A\x02\xE0A\x05\xFAA\x1F\x0A\x1Dstorage.googleapis.com/Bucket\x12k\x0A\x16hierarchical_namespace\x18\x04 \x01(\x0B2C.google.cloud.hypercomputecluster.v1.GcsHierarchicalNamespaceConfigB\x06\xE0A\x01\xE0A\x05\"d\x0A\x0CStorageClass\x12\x1D\x0A\x19STORAGE_CLASS_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08STANDARD\x10\x01\x12\x0C\x0A\x08NEARLINE\x10\x02\x12\x0C\x0A\x08COLDLINE\x10\x03\x12\x0B\x0A\x07ARCHIVE\x10\x04B\x08\x0A\x06option\"\xDD\x01\x0A\x12GcsAutoclassConfig\x12\x14\x0A\x07enabled\x18\x01 \x01(\x08B\x03\xE0A\x02\x12q\x0A\x16terminal_storage_class\x18\x02 \x01(\x0E2L.google.cloud.hypercomputecluster.v1.GcsAutoclassConfig.TerminalStorageClassB\x03\xE0A\x01\">\x0A\x14TerminalStorageClass\x12&\x0A\"TERMINAL_STORAGE_CLASS_UNSPECIFIED\x10\x00\"6\x0A\x1EGcsHierarchicalNamespaceConfig\x12\x14\x0A\x07enabled\x18\x01 \x01(\x08B\x03\xE0A\x02\"P\x0A\x14ExistingBucketConfig\x128\x0A\x06bucket\x18\x01 \x01(\x09B(\xE0A\x02\xE0A\x05\xFAA\x1F\x0A\x1Dstorage.googleapis.com/Bucket\"\x7F\x0A\x0FNewLustreConfig\x12\x16\x0A\x06lustre\x18\x01 \x01(\x09B\x06\xE0A\x02\xE0A\x05\x12\x1B\x0A\x0Bdescription\x18\x02 \x01(\x09B\x06\xE0A\x01\xE0A\x05\x12\x1A\x0A\x0Afilesystem\x18\x03 \x01(\x09B\x06\xE0A\x02\xE0A\x05\x12\x1B\x0A\x0Bcapacity_gb\x18\x04 \x01(\x03B\x06\xE0A\x02\xE0A\x05\"Q\x0A\x14ExistingLustreConfig\x129\x0A\x06lustre\x18\x01 \x01(\x09B)\xE0A\x02\xE0A\x05\xFAA \x0A\x1Elustre.googleapis.com/Instance\"e\x0A\x0FComputeResource\x12R\x0A\x06config\x18\x06 \x01(\x0B2:.google.cloud.hypercomputecluster.v1.ComputeResourceConfigB\x06\xE0A\x02\xE0A\x05\"\xC9\x03\x0A\x15ComputeResourceConfig\x12j\x0A\x17new_on_demand_instances\x18\x01 \x01(\x0B2?.google.cloud.hypercomputecluster.v1.NewOnDemandInstancesConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12a\x0A\x12new_spot_instances\x18\x02 \x01(\x0B2;.google.cloud.hypercomputecluster.v1.NewSpotInstancesConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12i\x0A\x16new_reserved_instances\x18\x03 \x01(\x0B2?.google.cloud.hypercomputecluster.v1.NewReservedInstancesConfigB\x06\xE0A\x01\xE0A\x05H\x00\x12l\x0A\x18new_flex_start_instances\x18\x05 \x01(\x0B2@.google.cloud.hypercomputecluster.v1.NewFlexStartInstancesConfigB\x06\xE0A\x01\xE0A\x05H\x00B\x08\x0A\x06config\"P\x0A\x1ANewOnDemandInstancesConfig\x12\x14\x0A\x04zone\x18\x01 \x01(\x09B\x06\xE0A\x02\xE0A\x05\x12\x1C\x0A\x0Cmachine_type\x18\x02 \x01(\x09B\x06\xE0A\x02\xE0A\x05\"\x8B\x02\x0A\x16NewSpotInstancesConfig\x12\x14\x0A\x04zone\x18\x01 \x01(\x09B\x06\xE0A\x02\xE0A\x05\x12\x1C\x0A\x0Cmachine_type\x18\x02 \x01(\x09B\x06\xE0A\x02\xE0A\x05\x12n\x0A\x12termination_action\x18\x05 \x01(\x0E2M.google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig.TerminationActionB\x03\xE0A\x01\"M\x0A\x11TerminationAction\x12\"\x0A\x1ETERMINATION_ACTION_UNSPECIFIED\x10\x00\x12\x08\x0A\x04STOP\x10\x01\x12\x0A\x0A\x06DELETE\x10\x02\"l\x0A\x1ANewReservedInstancesConfig\x12D\x0A\x0Breservation\x18\x01 \x01(\x09B-\xE0A\x01\xE0A\x05\xFAA\$\x0A\"compute.googleapis.com/ReservationH\x00B\x08\x0A\x06source\"\x8A\x01\x0A\x1BNewFlexStartInstancesConfig\x12\x14\x0A\x04zone\x18\x01 \x01(\x09B\x06\xE0A\x02\xE0A\x05\x12\x1C\x0A\x0Cmachine_type\x18\x02 \x01(\x09B\x06\xE0A\x02\xE0A\x05\x127\x0A\x0Cmax_duration\x18\x03 \x01(\x0B2\x19.google.protobuf.DurationB\x06\xE0A\x02\xE0A\x05\"]\x0A\x08BootDisk\x128\x0A\x04type\x18\x01 \x01(\x09B*\xE0A\x02\xE0A\x05\xFAA!\x0A\x1Fcompute.googleapis.com/DiskType\x12\x17\x0A\x07size_gb\x18\x02 \x01(\x03B\x06\xE0A\x02\xE0A\x05\"f\x0A\x0COrchestrator\x12L\x0A\x05slurm\x18\x01 \x01(\x0B26.google.cloud.hypercomputecluster.v1.SlurmOrchestratorB\x03\xE0A\x01H\x00B\x08\x0A\x06option\"\xE0\x02\x0A\x11SlurmOrchestrator\x12N\x0A\x0Blogin_nodes\x18\x06 \x01(\x0B24.google.cloud.hypercomputecluster.v1.SlurmLoginNodesB\x03\xE0A\x02\x12I\x0A\x09node_sets\x18\x01 \x03(\x0B21.google.cloud.hypercomputecluster.v1.SlurmNodeSetB\x03\xE0A\x01\x12L\x0A\x0Apartitions\x18\x02 \x03(\x0B23.google.cloud.hypercomputecluster.v1.SlurmPartitionB\x03\xE0A\x01\x12\x1E\x0A\x11default_partition\x18\x03 \x01(\x09B\x03\xE0A\x01\x12 \x0A\x13prolog_bash_scripts\x18\x04 \x03(\x09B\x03\xE0A\x01\x12 \x0A\x13epilog_bash_scripts\x18\x05 \x03(\x09B\x03\xE0A\x01\"\xBA\x02\x0A\x0CSlurmNodeSet\x12a\x0A\x10compute_instance\x18\x11 \x01(\x0B2@.google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSetB\x03\xE0A\x01H\x00\x12\x0F\x0A\x02id\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Acompute_id\x18\x10 \x01(\x09B\x03\xE0A\x01\x12P\x0A\x0Fstorage_configs\x18\x03 \x03(\x0B22.google.cloud.hypercomputecluster.v1.StorageConfigB\x03\xE0A\x01\x12\x1E\x0A\x11static_node_count\x18\x04 \x01(\x03B\x03\xE0A\x01\x12#\x0A\x16max_dynamic_node_count\x18\x05 \x01(\x03B\x03\xE0A\x01B\x06\x0A\x04type\"\x93\x02\x0A\x1BComputeInstanceSlurmNodeSet\x12\x1B\x0A\x0Estartup_script\x18\x01 \x01(\x09B\x03\xE0A\x01\x12a\x0A\x06labels\x18\x02 \x03(\x0B2L.google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet.LabelsEntryB\x03\xE0A\x01\x12E\x0A\x09boot_disk\x18\x03 \x01(\x0B2-.google.cloud.hypercomputecluster.v1.BootDiskB\x03\xE0A\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"<\x0A\x0ESlurmPartition\x12\x0F\x0A\x02id\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x19\x0A\x0Cnode_set_ids\x18\x02 \x03(\x09B\x03\xE0A\x02\"\x9B\x04\x0A\x0FSlurmLoginNodes\x12\x12\x0A\x05count\x18\x03 \x01(\x03B\x03\xE0A\x02\x12\x11\x0A\x04zone\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x19\x0A\x0Cmachine_type\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x1B\x0A\x0Estartup_script\x18\x05 \x01(\x09B\x03\xE0A\x01\x12\x1C\x0A\x0Fenable_os_login\x18\x06 \x01(\x08B\x03\xE0A\x01\x12\x1E\x0A\x11enable_public_ips\x18\x07 \x01(\x08B\x03\xE0A\x01\x12U\x0A\x06labels\x18\x08 \x03(\x0B2@.google.cloud.hypercomputecluster.v1.SlurmLoginNodes.LabelsEntryB\x03\xE0A\x01\x12P\x0A\x0Fstorage_configs\x18\x0C \x03(\x0B22.google.cloud.hypercomputecluster.v1.StorageConfigB\x03\xE0A\x01\x12L\x0A\x09instances\x18\x0A \x03(\x0B24.google.cloud.hypercomputecluster.v1.ComputeInstanceB\x03\xE0A\x03\x12E\x0A\x09boot_disk\x18\x0D \x01(\x0B2-.google.cloud.hypercomputecluster.v1.BootDiskB\x03\xE0A\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\":\x0A\x0DStorageConfig\x12\x0F\x0A\x02id\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x0Blocal_mount\x18\x02 \x01(\x09B\x03\xE0A\x02\"S\x0A\x0FComputeInstance\x12@\x0A\x08instance\x18\x01 \x01(\x09B.\xE0A\x03\xFAA(\x0A&compute.googleapis.com/ComputeInstance2\x88\x09\x0A\x13HypercomputeCluster\x12\xC2\x01\x0A\x0CListClusters\x128.google.cloud.hypercomputecluster.v1.ListClustersRequest\x1A9.google.cloud.hypercomputecluster.v1.ListClustersResponse\"=\xDAA\x06parent\x82\xD3\xE4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/clusters\x12\xAF\x01\x0A\x0AGetCluster\x126.google.cloud.hypercomputecluster.v1.GetClusterRequest\x1A,.google.cloud.hypercomputecluster.v1.Cluster\";\xDAA\x04name\x82\xD3\xE4\x93\x02.\x12,/v1/{name=projects/*/locations/*/clusters/*}\x12\xE3\x01\x0A\x0DCreateCluster\x129.google.cloud.hypercomputecluster.v1.CreateClusterRequest\x1A\x1D.google.longrunning.Operation\"x\xCAA\x1C\x0A\x07Cluster\x12\x11OperationMetadata\xDAA\x19parent,cluster,cluster_id\x82\xD3\xE4\x93\x027\",/v1/{parent=projects/*/locations/*}/clusters:\x07cluster\x12\xE5\x01\x0A\x0DUpdateCluster\x129.google.cloud.hypercomputecluster.v1.UpdateClusterRequest\x1A\x1D.google.longrunning.Operation\"z\xCAA\x1C\x0A\x07Cluster\x12\x11OperationMetadata\xDAA\x13cluster,update_mask\x82\xD3\xE4\x93\x02?24/v1/{cluster.name=projects/*/locations/*/clusters/*}:\x07cluster\x12\xD3\x01\x0A\x0DDeleteCluster\x129.google.cloud.hypercomputecluster.v1.DeleteClusterRequest\x1A\x1D.google.longrunning.Operation\"h\xCAA*\x0A\x15google.protobuf.Empty\x12\x11OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02.*,/v1/{name=projects/*/locations/*/clusters/*}\x1AV\xCAA\"hypercomputecluster.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xAD\x0A\x0A'com.google.cloud.hypercomputecluster.v1B\x18HypercomputeClusterProtoP\x01ZYcloud.google.com/go/hypercomputecluster/apiv1/hypercomputeclusterpb;hypercomputeclusterpb\xAA\x02#Google.Cloud.HypercomputeCluster.V1\xCA\x02#Google\\Cloud\\HypercomputeCluster\\V1\xEA\x02&Google::Cloud::HypercomputeCluster::V1\xEAA^\x0A&compute.googleapis.com/ComputeInstance\x124projects/{project}/zones/{zone}/instances/{instance}\xEAAX\x0A\x1Fcompute.googleapis.com/DiskType\x125projects/{project}/zones/{zone}/diskTypes/{disk_type}\xEAAH\x0A\x1Ccompute.googleapis.com/Image\x12(projects/{project}/global/images/{image}\xEAAN\x0A\x1Ecompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xEAA`\x0A\"compute.googleapis.com/Reservation\x12:projects/{project}/zones/{zone}/reservations/{reservation}\xEAA\x8B\x01\x0A'compute.googleapis.com/ReservationBlock\x12`projects/{project}/zones/{zone}/reservations/{reservation}/reservationBlocks/{reservation_block}\xEAA\xBC\x01\x0A*compute.googleapis.com/ReservationSubBlock\x12\x8D\x01projects/{project}/zones/{zone}/reservations/{reservation}/reservationBlocks/{reservation_block}/reservationSubBlocks/{reservation_sub_block}\xEAAa\x0A!compute.googleapis.com/Subnetwork\x12internalAddGeneratedFile( + "\x0A\xFC!\x0AsetParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $hypercomputeClusterClient->createCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = HypercomputeClusterClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + + create_cluster_sample($formattedParent, $clusterId); +} +// [END hypercomputecluster_v1_generated_HypercomputeCluster_CreateCluster_sync] diff --git a/HypercomputeCluster/samples/V1/HypercomputeClusterClient/delete_cluster.php b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/delete_cluster.php new file mode 100644 index 000000000000..2cff94ef8c82 --- /dev/null +++ b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/delete_cluster.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $hypercomputeClusterClient->deleteCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = HypercomputeClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + delete_cluster_sample($formattedName); +} +// [END hypercomputecluster_v1_generated_HypercomputeCluster_DeleteCluster_sync] diff --git a/HypercomputeCluster/samples/V1/HypercomputeClusterClient/get_cluster.php b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/get_cluster.php new file mode 100644 index 000000000000..5772c819ffcd --- /dev/null +++ b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/get_cluster.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Cluster $response */ + $response = $hypercomputeClusterClient->getCluster($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = HypercomputeClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + get_cluster_sample($formattedName); +} +// [END hypercomputecluster_v1_generated_HypercomputeCluster_GetCluster_sync] diff --git a/HypercomputeCluster/samples/V1/HypercomputeClusterClient/get_location.php b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/get_location.php new file mode 100644 index 000000000000..5c791d7cf83e --- /dev/null +++ b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END hypercomputecluster_v1_generated_HypercomputeCluster_GetLocation_sync] diff --git a/HypercomputeCluster/samples/V1/HypercomputeClusterClient/list_clusters.php b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/list_clusters.php new file mode 100644 index 000000000000..f988db2709a4 --- /dev/null +++ b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/list_clusters.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $hypercomputeClusterClient->listClusters($request); + + /** @var Cluster $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = HypercomputeClusterClient::locationName('[PROJECT]', '[LOCATION]'); + + list_clusters_sample($formattedParent); +} +// [END hypercomputecluster_v1_generated_HypercomputeCluster_ListClusters_sync] diff --git a/HypercomputeCluster/samples/V1/HypercomputeClusterClient/list_locations.php b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/list_locations.php new file mode 100644 index 000000000000..6897dd788455 --- /dev/null +++ b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/list_locations.php @@ -0,0 +1,69 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END hypercomputecluster_v1_generated_HypercomputeCluster_ListLocations_sync] diff --git a/HypercomputeCluster/samples/V1/HypercomputeClusterClient/update_cluster.php b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/update_cluster.php new file mode 100644 index 000000000000..15177322440a --- /dev/null +++ b/HypercomputeCluster/samples/V1/HypercomputeClusterClient/update_cluster.php @@ -0,0 +1,71 @@ +setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $hypercomputeClusterClient->updateCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END hypercomputecluster_v1_generated_HypercomputeCluster_UpdateCluster_sync] diff --git a/HypercomputeCluster/src/V1/BootDisk.php b/HypercomputeCluster/src/V1/BootDisk.php new file mode 100644 index 000000000000..14574feec4a5 --- /dev/null +++ b/HypercomputeCluster/src/V1/BootDisk.php @@ -0,0 +1,110 @@ +google.cloud.hypercomputecluster.v1.BootDisk + */ +class BootDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. [Persistent disk + * type](https://cloud.google.com/compute/docs/disks#disk-types), in the + * format `projects/{project}/zones/{zone}/diskTypes/{disk_type}`. + * + * Generated from protobuf field string type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $type = ''; + /** + * Required. Immutable. Size of the disk in gigabytes. Must be at least 10GB. + * + * Generated from protobuf field int64 size_gb = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $size_gb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * Required. Immutable. [Persistent disk + * type](https://cloud.google.com/compute/docs/disks#disk-types), in the + * format `projects/{project}/zones/{zone}/diskTypes/{disk_type}`. + * @type int|string $size_gb + * Required. Immutable. Size of the disk in gigabytes. Must be at least 10GB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. [Persistent disk + * type](https://cloud.google.com/compute/docs/disks#disk-types), in the + * format `projects/{project}/zones/{zone}/diskTypes/{disk_type}`. + * + * Generated from protobuf field string type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Required. Immutable. [Persistent disk + * type](https://cloud.google.com/compute/docs/disks#disk-types), in the + * format `projects/{project}/zones/{zone}/diskTypes/{disk_type}`. + * + * Generated from protobuf field string type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Required. Immutable. Size of the disk in gigabytes. Must be at least 10GB. + * + * Generated from protobuf field int64 size_gb = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int|string + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * Required. Immutable. Size of the disk in gigabytes. Must be at least 10GB. + * + * Generated from protobuf field int64 size_gb = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/BucketReference.php b/HypercomputeCluster/src/V1/BucketReference.php new file mode 100644 index 000000000000..ddd6e5533677 --- /dev/null +++ b/HypercomputeCluster/src/V1/BucketReference.php @@ -0,0 +1,68 @@ +google.cloud.hypercomputecluster.v1.BucketReference + */ +class BucketReference extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $bucket = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Output only. Name of the bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/CheckClusterHealth.php b/HypercomputeCluster/src/V1/CheckClusterHealth.php new file mode 100644 index 000000000000..adde2a8ea686 --- /dev/null +++ b/HypercomputeCluster/src/V1/CheckClusterHealth.php @@ -0,0 +1,34 @@ +google.cloud.hypercomputecluster.v1.CheckClusterHealth + */ +class CheckClusterHealth extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/Client/HypercomputeClusterClient.php b/HypercomputeCluster/src/V1/Client/HypercomputeClusterClient.php new file mode 100644 index 000000000000..96fbdb54bc6e --- /dev/null +++ b/HypercomputeCluster/src/V1/Client/HypercomputeClusterClient.php @@ -0,0 +1,658 @@ + createClusterAsync(CreateClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteClusterAsync(DeleteClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getClusterAsync(GetClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface listClustersAsync(ListClustersRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateClusterAsync(UpdateClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class HypercomputeClusterClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.hypercomputecluster.v1.HypercomputeCluster'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'hypercomputecluster.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'hypercomputecluster.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/hypercompute_cluster_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/hypercompute_cluster_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/hypercompute_cluster_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/hypercompute_cluster_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a bucket + * resource. + * + * @param string $project + * @param string $bucket + * + * @return string The formatted bucket resource. + */ + public static function bucketName(string $project, string $bucket): string + { + return self::getPathTemplate('bucket')->render([ + 'project' => $project, + 'bucket' => $bucket, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName(string $project, string $location, string $cluster): string + { + return self::getPathTemplate('cluster')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * compute_instance resource. + * + * @param string $project + * @param string $zone + * @param string $instance + * + * @return string The formatted compute_instance resource. + */ + public static function computeInstanceName(string $project, string $zone, string $instance): string + { + return self::getPathTemplate('computeInstance')->render([ + 'project' => $project, + 'zone' => $zone, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a disk_type + * resource. + * + * @param string $project + * @param string $zone + * @param string $diskType + * + * @return string The formatted disk_type resource. + */ + public static function diskTypeName(string $project, string $zone, string $diskType): string + { + return self::getPathTemplate('diskType')->render([ + 'project' => $project, + 'zone' => $zone, + 'disk_type' => $diskType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * file_instance resource. + * + * @param string $project + * @param string $location + * @param string $instance + * + * @return string The formatted file_instance resource. + */ + public static function fileInstanceName(string $project, string $location, string $instance): string + { + return self::getPathTemplate('fileInstance')->render([ + 'project' => $project, + 'location' => $location, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $location, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'location' => $location, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName(string $project, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a reservation + * resource. + * + * @param string $project + * @param string $zone + * @param string $reservation + * + * @return string The formatted reservation resource. + */ + public static function reservationName(string $project, string $zone, string $reservation): string + { + return self::getPathTemplate('reservation')->render([ + 'project' => $project, + 'zone' => $zone, + 'reservation' => $reservation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a subnetwork + * resource. + * + * @param string $project + * @param string $region + * @param string $subnetwork + * + * @return string The formatted subnetwork resource. + */ + public static function subnetworkName(string $project, string $region, string $subnetwork): string + { + return self::getPathTemplate('subnetwork')->render([ + 'project' => $project, + 'region' => $region, + 'subnetwork' => $subnetwork, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - bucket: projects/{project}/buckets/{bucket} + * - cluster: projects/{project}/locations/{location}/clusters/{cluster} + * - computeInstance: projects/{project}/zones/{zone}/instances/{instance} + * - diskType: projects/{project}/zones/{zone}/diskTypes/{disk_type} + * - fileInstance: projects/{project}/locations/{location}/instances/{instance} + * - instance: projects/{project}/locations/{location}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/global/networks/{network} + * - reservation: projects/{project}/zones/{zone}/reservations/{reservation} + * - subnetwork: projects/{project}/regions/{region}/subnetworks/{subnetwork} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'hypercomputecluster.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\HypercomputeCluster\V1\HypercomputeClusterClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new HypercomputeClusterClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new Cluster in a given project and location. + * + * The async variant is {@see HypercomputeClusterClient::createClusterAsync()} . + * + * @example samples/V1/HypercomputeClusterClient/create_cluster.php + * + * @param CreateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Cluster. + * + * The async variant is {@see HypercomputeClusterClient::deleteClusterAsync()} . + * + * @example samples/V1/HypercomputeClusterClient/delete_cluster.php + * + * @param DeleteClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteCluster(DeleteClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Cluster. + * + * The async variant is {@see HypercomputeClusterClient::getClusterAsync()} . + * + * @example samples/V1/HypercomputeClusterClient/get_cluster.php + * + * @param GetClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Cluster + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster + { + return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); + } + + /** + * Lists Clusters in a given project and location. + * + * The async variant is {@see HypercomputeClusterClient::listClustersAsync()} . + * + * @example samples/V1/HypercomputeClusterClient/list_clusters.php + * + * @param ListClustersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listClusters(ListClustersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListClusters', $request, $callOptions); + } + + /** + * Updates the parameters of a single Cluster. + * + * The async variant is {@see HypercomputeClusterClient::updateClusterAsync()} . + * + * @example samples/V1/HypercomputeClusterClient/update_cluster.php + * + * @param UpdateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCluster(UpdateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see HypercomputeClusterClient::getLocationAsync()} . + * + * @example samples/V1/HypercomputeClusterClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + This method can be called in two ways: + + * **List all public locations:** Use the path `GET /v1/locations`. + * **List project-visible locations:** Use the path + `GET /v1/projects/{project_id}/locations`. This may include public + locations as well as private or other locations specifically visible + to the project. + * + * The async variant is {@see HypercomputeClusterClient::listLocationsAsync()} . + * + * @example samples/V1/HypercomputeClusterClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/HypercomputeCluster/src/V1/Cluster.php b/HypercomputeCluster/src/V1/Cluster.php new file mode 100644 index 000000000000..de96026ebc6d --- /dev/null +++ b/HypercomputeCluster/src/V1/Cluster.php @@ -0,0 +1,480 @@ +google.cloud.hypercomputecluster.v1.Cluster + */ +class Cluster extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. [Relative resource name](https://google.aip.dev/122) of the + * cluster, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. User-provided description of the cluster. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) applied + * to the cluster. Labels can be used to organize clusters and to filter them + * in queries. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. Time that the cluster was originally created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Time that the cluster was most recently updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Indicates whether changes to the cluster are currently in + * flight. If this is `true`, then the current state might not match the + * cluster's intended state. + * + * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Optional. Network resources available to the cluster. Must contain at most + * one value. Keys specify the ID of the network resource by which it can be + * referenced elsewhere, and must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map network_resources = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_resources; + /** + * Optional. Storage resources available to the cluster. Keys specify the ID + * of the storage resource by which it can be referenced elsewhere, and must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map storage_resources = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $storage_resources; + /** + * Optional. Compute resources available to the cluster. Keys specify the ID + * of the compute resource by which it can be referenced elsewhere, and must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map compute_resources = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $compute_resources; + /** + * Optional. Orchestrator that is responsible for scheduling and running jobs + * on the cluster. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Orchestrator orchestrator = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $orchestrator = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. [Relative resource name](https://google.aip.dev/122) of the + * cluster, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * @type string $description + * Optional. User-provided description of the cluster. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) applied + * to the cluster. Labels can be used to organize clusters and to filter them + * in queries. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time that the cluster was originally created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time that the cluster was most recently updated. + * @type bool $reconciling + * Output only. Indicates whether changes to the cluster are currently in + * flight. If this is `true`, then the current state might not match the + * cluster's intended state. + * @type array|\Google\Protobuf\Internal\MapField $network_resources + * Optional. Network resources available to the cluster. Must contain at most + * one value. Keys specify the ID of the network resource by which it can be + * referenced elsewhere, and must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * @type array|\Google\Protobuf\Internal\MapField $storage_resources + * Optional. Storage resources available to the cluster. Keys specify the ID + * of the storage resource by which it can be referenced elsewhere, and must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * @type array|\Google\Protobuf\Internal\MapField $compute_resources + * Optional. Compute resources available to the cluster. Keys specify the ID + * of the compute resource by which it can be referenced elsewhere, and must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * @type \Google\Cloud\HypercomputeCluster\V1\Orchestrator $orchestrator + * Optional. Orchestrator that is responsible for scheduling and running jobs + * on the cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. [Relative resource name](https://google.aip.dev/122) of the + * cluster, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. [Relative resource name](https://google.aip.dev/122) of the + * cluster, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. User-provided description of the cluster. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. User-provided description of the cluster. + * + * Generated from protobuf field string description = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) applied + * to the cluster. Labels can be used to organize clusters and to filter them + * in queries. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) applied + * to the cluster. Labels can be used to organize clusters and to filter them + * in queries. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Time that the cluster was originally created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time that the cluster was originally created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Time that the cluster was most recently updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Time that the cluster was most recently updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Indicates whether changes to the cluster are currently in + * flight. If this is `true`, then the current state might not match the + * cluster's intended state. + * + * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Indicates whether changes to the cluster are currently in + * flight. If this is `true`, then the current state might not match the + * cluster's intended state. + * + * Generated from protobuf field bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Optional. Network resources available to the cluster. Must contain at most + * one value. Keys specify the ID of the network resource by which it can be + * referenced elsewhere, and must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map network_resources = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getNetworkResources() + { + return $this->network_resources; + } + + /** + * Optional. Network resources available to the cluster. Must contain at most + * one value. Keys specify the ID of the network resource by which it can be + * referenced elsewhere, and must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map network_resources = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setNetworkResources($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\NetworkResource::class); + $this->network_resources = $arr; + + return $this; + } + + /** + * Optional. Storage resources available to the cluster. Keys specify the ID + * of the storage resource by which it can be referenced elsewhere, and must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map storage_resources = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getStorageResources() + { + return $this->storage_resources; + } + + /** + * Optional. Storage resources available to the cluster. Keys specify the ID + * of the storage resource by which it can be referenced elsewhere, and must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map storage_resources = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setStorageResources($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\StorageResource::class); + $this->storage_resources = $arr; + + return $this; + } + + /** + * Optional. Compute resources available to the cluster. Keys specify the ID + * of the compute resource by which it can be referenced elsewhere, and must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map compute_resources = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getComputeResources() + { + return $this->compute_resources; + } + + /** + * Optional. Compute resources available to the cluster. Keys specify the ID + * of the compute resource by which it can be referenced elsewhere, and must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field map compute_resources = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setComputeResources($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\ComputeResource::class); + $this->compute_resources = $arr; + + return $this; + } + + /** + * Optional. Orchestrator that is responsible for scheduling and running jobs + * on the cluster. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Orchestrator orchestrator = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\HypercomputeCluster\V1\Orchestrator|null + */ + public function getOrchestrator() + { + return $this->orchestrator; + } + + public function hasOrchestrator() + { + return isset($this->orchestrator); + } + + public function clearOrchestrator() + { + unset($this->orchestrator); + } + + /** + * Optional. Orchestrator that is responsible for scheduling and running jobs + * on the cluster. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Orchestrator orchestrator = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\Orchestrator $var + * @return $this + */ + public function setOrchestrator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\Orchestrator::class); + $this->orchestrator = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ComputeInstance.php b/HypercomputeCluster/src/V1/ComputeInstance.php new file mode 100644 index 000000000000..57c157b99061 --- /dev/null +++ b/HypercomputeCluster/src/V1/ComputeInstance.php @@ -0,0 +1,72 @@ +google.cloud.hypercomputecluster.v1.ComputeInstance + */ +class ComputeInstance extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the VM instance, in the format + * `projects/{project}/zones/{zone}/instances/{instance}`. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $instance = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Output only. Name of the VM instance, in the format + * `projects/{project}/zones/{zone}/instances/{instance}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the VM instance, in the format + * `projects/{project}/zones/{zone}/instances/{instance}`. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Output only. Name of the VM instance, in the format + * `projects/{project}/zones/{zone}/instances/{instance}`. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ComputeInstanceSlurmNodeSet.php b/HypercomputeCluster/src/V1/ComputeInstanceSlurmNodeSet.php new file mode 100644 index 000000000000..0b474f5d13ec --- /dev/null +++ b/HypercomputeCluster/src/V1/ComputeInstanceSlurmNodeSet.php @@ -0,0 +1,163 @@ +google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet + */ +class ComputeInstanceSlurmNodeSet extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. [Startup + * script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux) + * to be run on each VM instance in the nodeset. Max 256KB. + * + * Generated from protobuf field string startup_script = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $startup_script = ''; + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) that + * should be applied to each VM instance in the nodeset. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Boot disk for the compute instance + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.BootDisk boot_disk = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $startup_script + * Optional. [Startup + * script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux) + * to be run on each VM instance in the nodeset. Max 256KB. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) that + * should be applied to each VM instance in the nodeset. + * @type \Google\Cloud\HypercomputeCluster\V1\BootDisk $boot_disk + * Optional. Boot disk for the compute instance + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. [Startup + * script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux) + * to be run on each VM instance in the nodeset. Max 256KB. + * + * Generated from protobuf field string startup_script = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getStartupScript() + { + return $this->startup_script; + } + + /** + * Optional. [Startup + * script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux) + * to be run on each VM instance in the nodeset. Max 256KB. + * + * Generated from protobuf field string startup_script = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setStartupScript($var) + { + GPBUtil::checkString($var, True); + $this->startup_script = $var; + + return $this; + } + + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) that + * should be applied to each VM instance in the nodeset. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) that + * should be applied to each VM instance in the nodeset. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Boot disk for the compute instance + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.BootDisk boot_disk = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\HypercomputeCluster\V1\BootDisk|null + */ + public function getBootDisk() + { + return $this->boot_disk; + } + + public function hasBootDisk() + { + return isset($this->boot_disk); + } + + public function clearBootDisk() + { + unset($this->boot_disk); + } + + /** + * Optional. Boot disk for the compute instance + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.BootDisk boot_disk = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\BootDisk $var + * @return $this + */ + public function setBootDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\BootDisk::class); + $this->boot_disk = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ComputeResource.php b/HypercomputeCluster/src/V1/ComputeResource.php new file mode 100644 index 000000000000..7203fa20eef5 --- /dev/null +++ b/HypercomputeCluster/src/V1/ComputeResource.php @@ -0,0 +1,82 @@ +google.cloud.hypercomputecluster.v1.ComputeResource + */ +class ComputeResource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Configuration for this compute resource, which + * describes how it should be created at runtime. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ComputeResourceConfig config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\ComputeResourceConfig $config + * Required. Immutable. Configuration for this compute resource, which + * describes how it should be created at runtime. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Configuration for this compute resource, which + * describes how it should be created at runtime. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ComputeResourceConfig config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\ComputeResourceConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Required. Immutable. Configuration for this compute resource, which + * describes how it should be created at runtime. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ComputeResourceConfig config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\ComputeResourceConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\ComputeResourceConfig::class); + $this->config = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ComputeResourceConfig.php b/HypercomputeCluster/src/V1/ComputeResourceConfig.php new file mode 100644 index 000000000000..73d4eae8b087 --- /dev/null +++ b/HypercomputeCluster/src/V1/ComputeResourceConfig.php @@ -0,0 +1,186 @@ +google.cloud.hypercomputecluster.v1.ComputeResourceConfig + */ +class ComputeResourceConfig extends \Google\Protobuf\Internal\Message +{ + protected $config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\NewOnDemandInstancesConfig $new_on_demand_instances + * Optional. Immutable. If set, indicates that this resource should use + * on-demand VMs. + * @type \Google\Cloud\HypercomputeCluster\V1\NewSpotInstancesConfig $new_spot_instances + * Optional. Immutable. If set, indicates that this resource should use spot + * VMs. + * @type \Google\Cloud\HypercomputeCluster\V1\NewReservedInstancesConfig $new_reserved_instances + * Optional. Immutable. If set, indicates that this resource should use + * reserved VMs. + * @type \Google\Cloud\HypercomputeCluster\V1\NewFlexStartInstancesConfig $new_flex_start_instances + * Optional. Immutable. If set, indicates that this resource should use + * flex-start VMs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Immutable. If set, indicates that this resource should use + * on-demand VMs. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewOnDemandInstancesConfig new_on_demand_instances = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NewOnDemandInstancesConfig|null + */ + public function getNewOnDemandInstances() + { + return $this->readOneof(1); + } + + public function hasNewOnDemandInstances() + { + return $this->hasOneof(1); + } + + /** + * Optional. Immutable. If set, indicates that this resource should use + * on-demand VMs. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewOnDemandInstancesConfig new_on_demand_instances = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NewOnDemandInstancesConfig $var + * @return $this + */ + public function setNewOnDemandInstances($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NewOnDemandInstancesConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that this resource should use spot + * VMs. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig new_spot_instances = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NewSpotInstancesConfig|null + */ + public function getNewSpotInstances() + { + return $this->readOneof(2); + } + + public function hasNewSpotInstances() + { + return $this->hasOneof(2); + } + + /** + * Optional. Immutable. If set, indicates that this resource should use spot + * VMs. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig new_spot_instances = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NewSpotInstancesConfig $var + * @return $this + */ + public function setNewSpotInstances($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NewSpotInstancesConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that this resource should use + * reserved VMs. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewReservedInstancesConfig new_reserved_instances = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NewReservedInstancesConfig|null + */ + public function getNewReservedInstances() + { + return $this->readOneof(3); + } + + public function hasNewReservedInstances() + { + return $this->hasOneof(3); + } + + /** + * Optional. Immutable. If set, indicates that this resource should use + * reserved VMs. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewReservedInstancesConfig new_reserved_instances = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NewReservedInstancesConfig $var + * @return $this + */ + public function setNewReservedInstances($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NewReservedInstancesConfig::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that this resource should use + * flex-start VMs. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFlexStartInstancesConfig new_flex_start_instances = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NewFlexStartInstancesConfig|null + */ + public function getNewFlexStartInstances() + { + return $this->readOneof(5); + } + + public function hasNewFlexStartInstances() + { + return $this->hasOneof(5); + } + + /** + * Optional. Immutable. If set, indicates that this resource should use + * flex-start VMs. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFlexStartInstancesConfig new_flex_start_instances = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NewFlexStartInstancesConfig $var + * @return $this + */ + public function setNewFlexStartInstances($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NewFlexStartInstancesConfig::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getConfig() + { + return $this->whichOneof("config"); + } + +} + diff --git a/HypercomputeCluster/src/V1/CreateClusterRequest.php b/HypercomputeCluster/src/V1/CreateClusterRequest.php new file mode 100644 index 000000000000..8fe9e626f216 --- /dev/null +++ b/HypercomputeCluster/src/V1/CreateClusterRequest.php @@ -0,0 +1,221 @@ +google.cloud.hypercomputecluster.v1.CreateClusterRequest + */ +class CreateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent location in which the cluster should be created, in the + * format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the cluster to create. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. Cluster to create. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Parent location in which the cluster should be created, in the + * format `projects/{project}/locations/{location}`. Please see + * {@see HypercomputeClusterClient::locationName()} for help formatting this field. + * @param \Google\Cloud\HypercomputeCluster\V1\Cluster $cluster Required. Cluster to create. + * @param string $clusterId Required. ID of the cluster to create. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * @return \Google\Cloud\HypercomputeCluster\V1\CreateClusterRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\HypercomputeCluster\V1\Cluster $cluster, string $clusterId): self + { + return (new self()) + ->setParent($parent) + ->setCluster($cluster) + ->setClusterId($clusterId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent location in which the cluster should be created, in the + * format `projects/{project}/locations/{location}`. + * @type string $cluster_id + * Required. ID of the cluster to create. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * @type \Google\Cloud\HypercomputeCluster\V1\Cluster $cluster + * Required. Cluster to create. + * @type string $request_id + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent location in which the cluster should be created, in the + * format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent location in which the cluster should be created, in the + * format `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. ID of the cluster to create. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. ID of the cluster to create. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. Cluster to create. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\HypercomputeCluster\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. Cluster to create. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\HypercomputeCluster\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/CreateFilestoreInstance.php b/HypercomputeCluster/src/V1/CreateFilestoreInstance.php new file mode 100644 index 000000000000..a5c382a7b79c --- /dev/null +++ b/HypercomputeCluster/src/V1/CreateFilestoreInstance.php @@ -0,0 +1,72 @@ +google.cloud.hypercomputecluster.v1.CreateFilestoreInstance + */ +class CreateFilestoreInstance extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $filestore = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filestore + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getFilestore() + { + return $this->filestore; + } + + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setFilestore($var) + { + GPBUtil::checkString($var, True); + $this->filestore = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/CreateLoginNode.php b/HypercomputeCluster/src/V1/CreateLoginNode.php new file mode 100644 index 000000000000..83f3155440ec --- /dev/null +++ b/HypercomputeCluster/src/V1/CreateLoginNode.php @@ -0,0 +1,33 @@ +google.cloud.hypercomputecluster.v1.CreateLoginNode + */ +class CreateLoginNode extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/CreateLustreInstance.php b/HypercomputeCluster/src/V1/CreateLustreInstance.php new file mode 100644 index 000000000000..bfae51a08fed --- /dev/null +++ b/HypercomputeCluster/src/V1/CreateLustreInstance.php @@ -0,0 +1,72 @@ +google.cloud.hypercomputecluster.v1.CreateLustreInstance + */ +class CreateLustreInstance extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $lustre = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $lustre + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getLustre() + { + return $this->lustre; + } + + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLustre($var) + { + GPBUtil::checkString($var, True); + $this->lustre = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/CreateNetwork.php b/HypercomputeCluster/src/V1/CreateNetwork.php new file mode 100644 index 000000000000..93fcc11d7303 --- /dev/null +++ b/HypercomputeCluster/src/V1/CreateNetwork.php @@ -0,0 +1,71 @@ +google.cloud.hypercomputecluster.v1.CreateNetwork + */ +class CreateNetwork extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the network to create, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $network = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Output only. Name of the network to create, in the format + * `projects/{project}/global/networks/{network}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the network to create, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Output only. Name of the network to create, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/CreateNodeset.php b/HypercomputeCluster/src/V1/CreateNodeset.php new file mode 100644 index 000000000000..857c68195aff --- /dev/null +++ b/HypercomputeCluster/src/V1/CreateNodeset.php @@ -0,0 +1,67 @@ +google.cloud.hypercomputecluster.v1.CreateNodeset + */ +class CreateNodeset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the nodeset to create + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $nodesets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $nodesets + * Output only. Name of the nodeset to create + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the nodeset to create + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField + */ + public function getNodesets() + { + return $this->nodesets; + } + + /** + * Output only. Name of the nodeset to create + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string[] $var + * @return $this + */ + public function setNodesets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nodesets = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/CreateOrchestrator.php b/HypercomputeCluster/src/V1/CreateOrchestrator.php new file mode 100644 index 000000000000..8cc1d0584bb2 --- /dev/null +++ b/HypercomputeCluster/src/V1/CreateOrchestrator.php @@ -0,0 +1,33 @@ +google.cloud.hypercomputecluster.v1.CreateOrchestrator + */ +class CreateOrchestrator extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/CreatePartition.php b/HypercomputeCluster/src/V1/CreatePartition.php new file mode 100644 index 000000000000..f967d5bf1e9e --- /dev/null +++ b/HypercomputeCluster/src/V1/CreatePartition.php @@ -0,0 +1,67 @@ +google.cloud.hypercomputecluster.v1.CreatePartition + */ +class CreatePartition extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the partition to create + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $partitions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $partitions + * Output only. Name of the partition to create + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the partition to create + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField + */ + public function getPartitions() + { + return $this->partitions; + } + + /** + * Output only. Name of the partition to create + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string[] $var + * @return $this + */ + public function setPartitions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->partitions = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/CreatePrivateServiceAccess.php b/HypercomputeCluster/src/V1/CreatePrivateServiceAccess.php new file mode 100644 index 000000000000..ca9c7b48ac58 --- /dev/null +++ b/HypercomputeCluster/src/V1/CreatePrivateServiceAccess.php @@ -0,0 +1,34 @@ +google.cloud.hypercomputecluster.v1.CreatePrivateServiceAccess + */ +class CreatePrivateServiceAccess extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/CreateStorageBucket.php b/HypercomputeCluster/src/V1/CreateStorageBucket.php new file mode 100644 index 000000000000..464be1b51ddb --- /dev/null +++ b/HypercomputeCluster/src/V1/CreateStorageBucket.php @@ -0,0 +1,68 @@ +google.cloud.hypercomputecluster.v1.CreateStorageBucket + */ +class CreateStorageBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $bucket = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Output only. Name of the bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/DeleteClusterRequest.php b/HypercomputeCluster/src/V1/DeleteClusterRequest.php new file mode 100644 index 000000000000..6e0960b2d736 --- /dev/null +++ b/HypercomputeCluster/src/V1/DeleteClusterRequest.php @@ -0,0 +1,129 @@ +google.cloud.hypercomputecluster.v1.DeleteClusterRequest + */ +class DeleteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the cluster to delete, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the cluster to delete, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. Please see + * {@see HypercomputeClusterClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\HypercomputeCluster\V1\DeleteClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the cluster to delete, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * @type string $request_id + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the cluster to delete, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the cluster to delete, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/DeleteFilestoreInstance.php b/HypercomputeCluster/src/V1/DeleteFilestoreInstance.php new file mode 100644 index 000000000000..11553012bf58 --- /dev/null +++ b/HypercomputeCluster/src/V1/DeleteFilestoreInstance.php @@ -0,0 +1,72 @@ +google.cloud.hypercomputecluster.v1.DeleteFilestoreInstance + */ +class DeleteFilestoreInstance extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $filestore = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filestore + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getFilestore() + { + return $this->filestore; + } + + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setFilestore($var) + { + GPBUtil::checkString($var, True); + $this->filestore = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/DeleteLoginNode.php b/HypercomputeCluster/src/V1/DeleteLoginNode.php new file mode 100644 index 000000000000..cff5cff228ad --- /dev/null +++ b/HypercomputeCluster/src/V1/DeleteLoginNode.php @@ -0,0 +1,33 @@ +google.cloud.hypercomputecluster.v1.DeleteLoginNode + */ +class DeleteLoginNode extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/DeleteLustreInstance.php b/HypercomputeCluster/src/V1/DeleteLustreInstance.php new file mode 100644 index 000000000000..ac98f3367f91 --- /dev/null +++ b/HypercomputeCluster/src/V1/DeleteLustreInstance.php @@ -0,0 +1,72 @@ +google.cloud.hypercomputecluster.v1.DeleteLustreInstance + */ +class DeleteLustreInstance extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $lustre = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $lustre + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getLustre() + { + return $this->lustre; + } + + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLustre($var) + { + GPBUtil::checkString($var, True); + $this->lustre = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/DeleteNetwork.php b/HypercomputeCluster/src/V1/DeleteNetwork.php new file mode 100644 index 000000000000..b818cfb5d6ac --- /dev/null +++ b/HypercomputeCluster/src/V1/DeleteNetwork.php @@ -0,0 +1,72 @@ +google.cloud.hypercomputecluster.v1.DeleteNetwork + */ +class DeleteNetwork extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the network to delete, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $network = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Output only. Name of the network to delete, in the format + * `projects/{project}/global/networks/{network}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the network to delete, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Output only. Name of the network to delete, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/DeleteNodeset.php b/HypercomputeCluster/src/V1/DeleteNodeset.php new file mode 100644 index 000000000000..786288d8ecbc --- /dev/null +++ b/HypercomputeCluster/src/V1/DeleteNodeset.php @@ -0,0 +1,67 @@ +google.cloud.hypercomputecluster.v1.DeleteNodeset + */ +class DeleteNodeset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the nodeset to delete + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $nodesets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $nodesets + * Output only. Name of the nodeset to delete + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the nodeset to delete + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField + */ + public function getNodesets() + { + return $this->nodesets; + } + + /** + * Output only. Name of the nodeset to delete + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string[] $var + * @return $this + */ + public function setNodesets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nodesets = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/DeleteOrchestrator.php b/HypercomputeCluster/src/V1/DeleteOrchestrator.php new file mode 100644 index 000000000000..41211cea86f3 --- /dev/null +++ b/HypercomputeCluster/src/V1/DeleteOrchestrator.php @@ -0,0 +1,33 @@ +google.cloud.hypercomputecluster.v1.DeleteOrchestrator + */ +class DeleteOrchestrator extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/DeletePartition.php b/HypercomputeCluster/src/V1/DeletePartition.php new file mode 100644 index 000000000000..829b5b3a35cf --- /dev/null +++ b/HypercomputeCluster/src/V1/DeletePartition.php @@ -0,0 +1,67 @@ +google.cloud.hypercomputecluster.v1.DeletePartition + */ +class DeletePartition extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the partition to delete + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $partitions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $partitions + * Output only. Name of the partition to delete + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the partition to delete + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField + */ + public function getPartitions() + { + return $this->partitions; + } + + /** + * Output only. Name of the partition to delete + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string[] $var + * @return $this + */ + public function setPartitions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->partitions = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/DeletePrivateServiceAccess.php b/HypercomputeCluster/src/V1/DeletePrivateServiceAccess.php new file mode 100644 index 000000000000..df427ae25cf2 --- /dev/null +++ b/HypercomputeCluster/src/V1/DeletePrivateServiceAccess.php @@ -0,0 +1,34 @@ +google.cloud.hypercomputecluster.v1.DeletePrivateServiceAccess + */ +class DeletePrivateServiceAccess extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/DeleteStorageBucket.php b/HypercomputeCluster/src/V1/DeleteStorageBucket.php new file mode 100644 index 000000000000..198f81938a2e --- /dev/null +++ b/HypercomputeCluster/src/V1/DeleteStorageBucket.php @@ -0,0 +1,68 @@ +google.cloud.hypercomputecluster.v1.DeleteStorageBucket + */ +class DeleteStorageBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $bucket = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Output only. Name of the bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Output only. Name of the bucket. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ExistingBucketConfig.php b/HypercomputeCluster/src/V1/ExistingBucketConfig.php new file mode 100644 index 000000000000..a08b71e1b78a --- /dev/null +++ b/HypercomputeCluster/src/V1/ExistingBucketConfig.php @@ -0,0 +1,70 @@ +google.cloud.hypercomputecluster.v1.ExistingBucketConfig + */ +class ExistingBucketConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the Cloud Storage bucket to import. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $bucket = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Required. Immutable. Name of the Cloud Storage bucket to import. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the Cloud Storage bucket to import. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Required. Immutable. Name of the Cloud Storage bucket to import. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ExistingFilestoreConfig.php b/HypercomputeCluster/src/V1/ExistingFilestoreConfig.php new file mode 100644 index 000000000000..6aa63c7bc83a --- /dev/null +++ b/HypercomputeCluster/src/V1/ExistingFilestoreConfig.php @@ -0,0 +1,74 @@ +google.cloud.hypercomputecluster.v1.ExistingFilestoreConfig + */ +class ExistingFilestoreConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the Filestore instance to import, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $filestore = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filestore + * Required. Immutable. Name of the Filestore instance to import, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the Filestore instance to import, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getFilestore() + { + return $this->filestore; + } + + /** + * Required. Immutable. Name of the Filestore instance to import, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setFilestore($var) + { + GPBUtil::checkString($var, True); + $this->filestore = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ExistingLustreConfig.php b/HypercomputeCluster/src/V1/ExistingLustreConfig.php new file mode 100644 index 000000000000..80ab0e9dd52c --- /dev/null +++ b/HypercomputeCluster/src/V1/ExistingLustreConfig.php @@ -0,0 +1,75 @@ +google.cloud.hypercomputecluster.v1.ExistingLustreConfig + */ +class ExistingLustreConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the Managed Lustre instance to import, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $lustre = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $lustre + * Required. Immutable. Name of the Managed Lustre instance to import, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the Managed Lustre instance to import, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getLustre() + { + return $this->lustre; + } + + /** + * Required. Immutable. Name of the Managed Lustre instance to import, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLustre($var) + { + GPBUtil::checkString($var, True); + $this->lustre = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ExistingNetworkConfig.php b/HypercomputeCluster/src/V1/ExistingNetworkConfig.php new file mode 100644 index 000000000000..200cea0e9eef --- /dev/null +++ b/HypercomputeCluster/src/V1/ExistingNetworkConfig.php @@ -0,0 +1,111 @@ +google.cloud.hypercomputecluster.v1.ExistingNetworkConfig + */ +class ExistingNetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the network to import, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Required. Immutable. Particular subnetwork to use, in the format + * `projects/{project}/regions/{region}/subnetworks/{subnetwork}`. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $subnetwork = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Required. Immutable. Name of the network to import, in the format + * `projects/{project}/global/networks/{network}`. + * @type string $subnetwork + * Required. Immutable. Particular subnetwork to use, in the format + * `projects/{project}/regions/{region}/subnetworks/{subnetwork}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the network to import, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. Immutable. Name of the network to import, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Required. Immutable. Particular subnetwork to use, in the format + * `projects/{project}/regions/{region}/subnetworks/{subnetwork}`. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Required. Immutable. Particular subnetwork to use, in the format + * `projects/{project}/regions/{region}/subnetworks/{subnetwork}`. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/FileShareConfig.php b/HypercomputeCluster/src/V1/FileShareConfig.php new file mode 100644 index 000000000000..c627f061d941 --- /dev/null +++ b/HypercomputeCluster/src/V1/FileShareConfig.php @@ -0,0 +1,109 @@ +google.cloud.hypercomputecluster.v1.FileShareConfig + */ +class FileShareConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Size of the filestore in GB. Must be between 1024 and 102400, and + * must meet scalability requirements described at + * https://cloud.google.com/filestore/docs/service-tiers. + * + * Generated from protobuf field int64 capacity_gb = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $capacity_gb = 0; + /** + * Required. Filestore share location + * + * Generated from protobuf field string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $file_share = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $capacity_gb + * Required. Size of the filestore in GB. Must be between 1024 and 102400, and + * must meet scalability requirements described at + * https://cloud.google.com/filestore/docs/service-tiers. + * @type string $file_share + * Required. Filestore share location + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Size of the filestore in GB. Must be between 1024 and 102400, and + * must meet scalability requirements described at + * https://cloud.google.com/filestore/docs/service-tiers. + * + * Generated from protobuf field int64 capacity_gb = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getCapacityGb() + { + return $this->capacity_gb; + } + + /** + * Required. Size of the filestore in GB. Must be between 1024 and 102400, and + * must meet scalability requirements described at + * https://cloud.google.com/filestore/docs/service-tiers. + * + * Generated from protobuf field int64 capacity_gb = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setCapacityGb($var) + { + GPBUtil::checkInt64($var); + $this->capacity_gb = $var; + + return $this; + } + + /** + * Required. Filestore share location + * + * Generated from protobuf field string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFileShare() + { + return $this->file_share; + } + + /** + * Required. Filestore share location + * + * Generated from protobuf field string file_share = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFileShare($var) + { + GPBUtil::checkString($var, True); + $this->file_share = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/FilestoreReference.php b/HypercomputeCluster/src/V1/FilestoreReference.php new file mode 100644 index 000000000000..129395bcd712 --- /dev/null +++ b/HypercomputeCluster/src/V1/FilestoreReference.php @@ -0,0 +1,71 @@ +google.cloud.hypercomputecluster.v1.FilestoreReference + */ +class FilestoreReference extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $filestore = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filestore + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getFilestore() + { + return $this->filestore; + } + + /** + * Output only. Name of the Filestore instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setFilestore($var) + { + GPBUtil::checkString($var, True); + $this->filestore = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/GcsAutoclassConfig.php b/HypercomputeCluster/src/V1/GcsAutoclassConfig.php new file mode 100644 index 000000000000..128667cec51b --- /dev/null +++ b/HypercomputeCluster/src/V1/GcsAutoclassConfig.php @@ -0,0 +1,101 @@ +google.cloud.hypercomputecluster.v1.GcsAutoclassConfig + */ +class GcsAutoclassConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Enables Auto-class feature. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $enabled = false; + /** + * Optional. Terminal storage class of the autoclass bucket + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.GcsAutoclassConfig.TerminalStorageClass terminal_storage_class = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $terminal_storage_class = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Required. Enables Auto-class feature. + * @type int $terminal_storage_class + * Optional. Terminal storage class of the autoclass bucket + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Enables Auto-class feature. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Required. Enables Auto-class feature. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * Optional. Terminal storage class of the autoclass bucket + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.GcsAutoclassConfig.TerminalStorageClass terminal_storage_class = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTerminalStorageClass() + { + return $this->terminal_storage_class; + } + + /** + * Optional. Terminal storage class of the autoclass bucket + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.GcsAutoclassConfig.TerminalStorageClass terminal_storage_class = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTerminalStorageClass($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\HypercomputeCluster\V1\GcsAutoclassConfig\TerminalStorageClass::class); + $this->terminal_storage_class = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/GcsAutoclassConfig/TerminalStorageClass.php b/HypercomputeCluster/src/V1/GcsAutoclassConfig/TerminalStorageClass.php new file mode 100644 index 000000000000..97fbba519b51 --- /dev/null +++ b/HypercomputeCluster/src/V1/GcsAutoclassConfig/TerminalStorageClass.php @@ -0,0 +1,47 @@ +google.cloud.hypercomputecluster.v1.GcsAutoclassConfig.TerminalStorageClass + */ +class TerminalStorageClass +{ + /** + * Unspecified terminal storage class + * + * Generated from protobuf enum TERMINAL_STORAGE_CLASS_UNSPECIFIED = 0; + */ + const TERMINAL_STORAGE_CLASS_UNSPECIFIED = 0; + + private static $valueToName = [ + self::TERMINAL_STORAGE_CLASS_UNSPECIFIED => 'TERMINAL_STORAGE_CLASS_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/HypercomputeCluster/src/V1/GcsHierarchicalNamespaceConfig.php b/HypercomputeCluster/src/V1/GcsHierarchicalNamespaceConfig.php new file mode 100644 index 000000000000..8f2f22ee905d --- /dev/null +++ b/HypercomputeCluster/src/V1/GcsHierarchicalNamespaceConfig.php @@ -0,0 +1,67 @@ +google.cloud.hypercomputecluster.v1.GcsHierarchicalNamespaceConfig + */ +class GcsHierarchicalNamespaceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Enables hierarchical namespace setup for the bucket. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $enabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Required. Enables hierarchical namespace setup for the bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Enables hierarchical namespace setup for the bucket. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Required. Enables hierarchical namespace setup for the bucket. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/GetClusterRequest.php b/HypercomputeCluster/src/V1/GetClusterRequest.php new file mode 100644 index 000000000000..fc76e632c4d7 --- /dev/null +++ b/HypercomputeCluster/src/V1/GetClusterRequest.php @@ -0,0 +1,87 @@ +google.cloud.hypercomputecluster.v1.GetClusterRequest + */ +class GetClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the cluster to retrieve, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the cluster to retrieve, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. Please see + * {@see HypercomputeClusterClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\HypercomputeCluster\V1\GetClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the cluster to retrieve, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the cluster to retrieve, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the cluster to retrieve, in the format + * `projects/{project}/locations/{location}/clusters/{cluster}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ListClustersRequest.php b/HypercomputeCluster/src/V1/ListClustersRequest.php new file mode 100644 index 000000000000..5075b8c59a57 --- /dev/null +++ b/HypercomputeCluster/src/V1/ListClustersRequest.php @@ -0,0 +1,267 @@ +google.cloud.hypercomputecluster.v1.ListClustersRequest + */ +class ListClustersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent location of the clusters to list, in the format + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of clusters to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters provided to `ListClusters` must match the call that provided the + * page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. [Filter](https://google.aip.dev/160) to apply to the returned + * results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. How to order the resulting clusters. Must be one of the following + * strings: + * * `name` + * * `name desc` + * * `create_time` + * * `create_time desc` + * If not specified, clusters will be returned in an arbitrary order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent location of the clusters to list, in the format + * `projects/{project}/locations/{location}`. Please see + * {@see HypercomputeClusterClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\HypercomputeCluster\V1\ListClustersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent location of the clusters to list, in the format + * `projects/{project}/locations/{location}`. + * @type int $page_size + * Optional. Maximum number of clusters to return. The service may return + * fewer than this value. + * @type string $page_token + * Optional. A page token received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters provided to `ListClusters` must match the call that provided the + * page token. + * @type string $filter + * Optional. [Filter](https://google.aip.dev/160) to apply to the returned + * results. + * @type string $order_by + * Optional. How to order the resulting clusters. Must be one of the following + * strings: + * * `name` + * * `name desc` + * * `create_time` + * * `create_time desc` + * If not specified, clusters will be returned in an arbitrary order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent location of the clusters to list, in the format + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent location of the clusters to list, in the format + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of clusters to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of clusters to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters provided to `ListClusters` must match the call that provided the + * page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters provided to `ListClusters` must match the call that provided the + * page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. [Filter](https://google.aip.dev/160) to apply to the returned + * results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. [Filter](https://google.aip.dev/160) to apply to the returned + * results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. How to order the resulting clusters. Must be one of the following + * strings: + * * `name` + * * `name desc` + * * `create_time` + * * `create_time desc` + * If not specified, clusters will be returned in an arbitrary order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. How to order the resulting clusters. Must be one of the following + * strings: + * * `name` + * * `name desc` + * * `create_time` + * * `create_time desc` + * If not specified, clusters will be returned in an arbitrary order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/ListClustersResponse.php b/HypercomputeCluster/src/V1/ListClustersResponse.php new file mode 100644 index 000000000000..85bf35d064c7 --- /dev/null +++ b/HypercomputeCluster/src/V1/ListClustersResponse.php @@ -0,0 +1,140 @@ +google.cloud.hypercomputecluster.v1.ListClustersResponse + */ +class ListClustersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Clusters in the specified location. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.Cluster clusters = 1; + */ + private $clusters; + /** + * A token that can be sent as `page_token` to retrieve the next page. If this + * field is absent, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\Cluster[] $clusters + * Clusters in the specified location. + * @type string $next_page_token + * A token that can be sent as `page_token` to retrieve the next page. If this + * field is absent, there are no subsequent pages. + * @type string[] $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Clusters in the specified location. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.Cluster clusters = 1; + * @return RepeatedField<\Google\Cloud\HypercomputeCluster\V1\Cluster> + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * Clusters in the specified location. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.Cluster clusters = 1; + * @param \Google\Cloud\HypercomputeCluster\V1\Cluster[] $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\Cluster::class); + $this->clusters = $arr; + + return $this; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. If this + * field is absent, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. If this + * field is absent, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param string[] $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/LustreReference.php b/HypercomputeCluster/src/V1/LustreReference.php new file mode 100644 index 000000000000..89a805f2a324 --- /dev/null +++ b/HypercomputeCluster/src/V1/LustreReference.php @@ -0,0 +1,72 @@ +google.cloud.hypercomputecluster.v1.LustreReference + */ +class LustreReference extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $lustre = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $lustre + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getLustre() + { + return $this->lustre; + } + + /** + * Output only. Name of the Managed Lustre instance, in the format + * `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLustre($var) + { + GPBUtil::checkString($var, True); + $this->lustre = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/NetworkReference.php b/HypercomputeCluster/src/V1/NetworkReference.php new file mode 100644 index 000000000000..673318d29f8d --- /dev/null +++ b/HypercomputeCluster/src/V1/NetworkReference.php @@ -0,0 +1,114 @@ +google.cloud.hypercomputecluster.v1.NetworkReference + */ +class NetworkReference extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the network, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Output only. Name of the particular subnetwork being used by the cluster, + * in the format + * `projects/{project}/regions/{region}/subnetworks/{subnetwork}`. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $subnetwork = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Output only. Name of the network, in the format + * `projects/{project}/global/networks/{network}`. + * @type string $subnetwork + * Output only. Name of the particular subnetwork being used by the cluster, + * in the format + * `projects/{project}/regions/{region}/subnetworks/{subnetwork}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the network, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Output only. Name of the network, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Output only. Name of the particular subnetwork being used by the cluster, + * in the format + * `projects/{project}/regions/{region}/subnetworks/{subnetwork}`. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Output only. Name of the particular subnetwork being used by the cluster, + * in the format + * `projects/{project}/regions/{region}/subnetworks/{subnetwork}`. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/NetworkResource.php b/HypercomputeCluster/src/V1/NetworkResource.php new file mode 100644 index 000000000000..fd13761f765f --- /dev/null +++ b/HypercomputeCluster/src/V1/NetworkResource.php @@ -0,0 +1,136 @@ +google.cloud.hypercomputecluster.v1.NetworkResource + */ +class NetworkResource extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Configuration for this network resource, which describes how it + * should be created or imported. This field only controls how the network + * resource is initially created or imported. Subsequent changes to the + * network resource should be made via the resource's API and will not be + * reflected in the configuration. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NetworkResourceConfig config = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $config = null; + protected $reference; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\NetworkReference $network + * Reference to a network in Google Compute Engine. + * @type \Google\Cloud\HypercomputeCluster\V1\NetworkResourceConfig $config + * Immutable. Configuration for this network resource, which describes how it + * should be created or imported. This field only controls how the network + * resource is initially created or imported. Subsequent changes to the + * network resource should be made via the resource's API and will not be + * reflected in the configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Reference to a network in Google Compute Engine. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NetworkReference network = 3; + * @return \Google\Cloud\HypercomputeCluster\V1\NetworkReference|null + */ + public function getNetwork() + { + return $this->readOneof(3); + } + + public function hasNetwork() + { + return $this->hasOneof(3); + } + + /** + * Reference to a network in Google Compute Engine. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NetworkReference network = 3; + * @param \Google\Cloud\HypercomputeCluster\V1\NetworkReference $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NetworkReference::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Immutable. Configuration for this network resource, which describes how it + * should be created or imported. This field only controls how the network + * resource is initially created or imported. Subsequent changes to the + * network resource should be made via the resource's API and will not be + * reflected in the configuration. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NetworkResourceConfig config = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NetworkResourceConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Immutable. Configuration for this network resource, which describes how it + * should be created or imported. This field only controls how the network + * resource is initially created or imported. Subsequent changes to the + * network resource should be made via the resource's API and will not be + * reflected in the configuration. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NetworkResourceConfig config = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NetworkResourceConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NetworkResourceConfig::class); + $this->config = $var; + + return $this; + } + + /** + * @return string + */ + public function getReference() + { + return $this->whichOneof("reference"); + } + +} + diff --git a/HypercomputeCluster/src/V1/NetworkResourceConfig.php b/HypercomputeCluster/src/V1/NetworkResourceConfig.php new file mode 100644 index 000000000000..414c9f162659 --- /dev/null +++ b/HypercomputeCluster/src/V1/NetworkResourceConfig.php @@ -0,0 +1,116 @@ +google.cloud.hypercomputecluster.v1.NetworkResourceConfig + */ +class NetworkResourceConfig extends \Google\Protobuf\Internal\Message +{ + protected $config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\NewNetworkConfig $new_network + * Optional. Immutable. If set, indicates that a new network should be + * created. + * @type \Google\Cloud\HypercomputeCluster\V1\ExistingNetworkConfig $existing_network + * Optional. Immutable. If set, indicates that an existing network should be + * imported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Immutable. If set, indicates that a new network should be + * created. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewNetworkConfig new_network = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NewNetworkConfig|null + */ + public function getNewNetwork() + { + return $this->readOneof(3); + } + + public function hasNewNetwork() + { + return $this->hasOneof(3); + } + + /** + * Optional. Immutable. If set, indicates that a new network should be + * created. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewNetworkConfig new_network = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NewNetworkConfig $var + * @return $this + */ + public function setNewNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NewNetworkConfig::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that an existing network should be + * imported. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ExistingNetworkConfig existing_network = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\ExistingNetworkConfig|null + */ + public function getExistingNetwork() + { + return $this->readOneof(4); + } + + public function hasExistingNetwork() + { + return $this->hasOneof(4); + } + + /** + * Optional. Immutable. If set, indicates that an existing network should be + * imported. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ExistingNetworkConfig existing_network = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\ExistingNetworkConfig $var + * @return $this + */ + public function setExistingNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\ExistingNetworkConfig::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getConfig() + { + return $this->whichOneof("config"); + } + +} + diff --git a/HypercomputeCluster/src/V1/NewBucketConfig.php b/HypercomputeCluster/src/V1/NewBucketConfig.php new file mode 100644 index 000000000000..74e9996ad82f --- /dev/null +++ b/HypercomputeCluster/src/V1/NewBucketConfig.php @@ -0,0 +1,203 @@ +google.cloud.hypercomputecluster.v1.NewBucketConfig + */ +class NewBucketConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the Cloud Storage bucket to create. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $bucket = ''; + /** + * Optional. Immutable. If set, indicates that the bucket should use + * [hierarchical + * namespaces](https://cloud.google.com/storage/docs/hns-overview). + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.GcsHierarchicalNamespaceConfig hierarchical_namespace = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $hierarchical_namespace = null; + protected $option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\GcsAutoclassConfig $autoclass + * Optional. Immutable. If set, indicates that the bucket should use + * [Autoclass](https://cloud.google.com/storage/docs/autoclass). + * @type int $storage_class + * Optional. Immutable. If set, uses the provided storage class as the + * bucket's default storage class. + * @type string $bucket + * Required. Immutable. Name of the Cloud Storage bucket to create. + * @type \Google\Cloud\HypercomputeCluster\V1\GcsHierarchicalNamespaceConfig $hierarchical_namespace + * Optional. Immutable. If set, indicates that the bucket should use + * [hierarchical + * namespaces](https://cloud.google.com/storage/docs/hns-overview). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Immutable. If set, indicates that the bucket should use + * [Autoclass](https://cloud.google.com/storage/docs/autoclass). + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.GcsAutoclassConfig autoclass = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\GcsAutoclassConfig|null + */ + public function getAutoclass() + { + return $this->readOneof(2); + } + + public function hasAutoclass() + { + return $this->hasOneof(2); + } + + /** + * Optional. Immutable. If set, indicates that the bucket should use + * [Autoclass](https://cloud.google.com/storage/docs/autoclass). + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.GcsAutoclassConfig autoclass = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\GcsAutoclassConfig $var + * @return $this + */ + public function setAutoclass($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\GcsAutoclassConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, uses the provided storage class as the + * bucket's default storage class. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewBucketConfig.StorageClass storage_class = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getStorageClass() + { + return $this->readOneof(3); + } + + public function hasStorageClass() + { + return $this->hasOneof(3); + } + + /** + * Optional. Immutable. If set, uses the provided storage class as the + * bucket's default storage class. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewBucketConfig.StorageClass storage_class = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setStorageClass($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\HypercomputeCluster\V1\NewBucketConfig\StorageClass::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Immutable. Name of the Cloud Storage bucket to create. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Required. Immutable. Name of the Cloud Storage bucket to create. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that the bucket should use + * [hierarchical + * namespaces](https://cloud.google.com/storage/docs/hns-overview). + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.GcsHierarchicalNamespaceConfig hierarchical_namespace = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\GcsHierarchicalNamespaceConfig|null + */ + public function getHierarchicalNamespace() + { + return $this->hierarchical_namespace; + } + + public function hasHierarchicalNamespace() + { + return isset($this->hierarchical_namespace); + } + + public function clearHierarchicalNamespace() + { + unset($this->hierarchical_namespace); + } + + /** + * Optional. Immutable. If set, indicates that the bucket should use + * [hierarchical + * namespaces](https://cloud.google.com/storage/docs/hns-overview). + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.GcsHierarchicalNamespaceConfig hierarchical_namespace = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\GcsHierarchicalNamespaceConfig $var + * @return $this + */ + public function setHierarchicalNamespace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\GcsHierarchicalNamespaceConfig::class); + $this->hierarchical_namespace = $var; + + return $this; + } + + /** + * @return string + */ + public function getOption() + { + return $this->whichOneof("option"); + } + +} + diff --git a/HypercomputeCluster/src/V1/NewBucketConfig/StorageClass.php b/HypercomputeCluster/src/V1/NewBucketConfig/StorageClass.php new file mode 100644 index 000000000000..0fda0a142d9b --- /dev/null +++ b/HypercomputeCluster/src/V1/NewBucketConfig/StorageClass.php @@ -0,0 +1,77 @@ +google.cloud.hypercomputecluster.v1.NewBucketConfig.StorageClass + */ +class StorageClass +{ + /** + * Not set. + * + * Generated from protobuf enum STORAGE_CLASS_UNSPECIFIED = 0; + */ + const STORAGE_CLASS_UNSPECIFIED = 0; + /** + * Best for data that is frequently accessed. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * Low-cost storage for data that is accessed less frequently. + * + * Generated from protobuf enum NEARLINE = 2; + */ + const NEARLINE = 2; + /** + * Very low-cost storage for infrequently accessed data. + * + * Generated from protobuf enum COLDLINE = 3; + */ + const COLDLINE = 3; + /** + * Lowest-cost storage for data archiving, online backup, and disaster + * recovery. + * + * Generated from protobuf enum ARCHIVE = 4; + */ + const ARCHIVE = 4; + + private static $valueToName = [ + self::STORAGE_CLASS_UNSPECIFIED => 'STORAGE_CLASS_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::NEARLINE => 'NEARLINE', + self::COLDLINE => 'COLDLINE', + self::ARCHIVE => 'ARCHIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/HypercomputeCluster/src/V1/NewFilestoreConfig.php b/HypercomputeCluster/src/V1/NewFilestoreConfig.php new file mode 100644 index 000000000000..ec37a6e0c694 --- /dev/null +++ b/HypercomputeCluster/src/V1/NewFilestoreConfig.php @@ -0,0 +1,222 @@ +google.cloud.hypercomputecluster.v1.NewFilestoreConfig + */ +class NewFilestoreConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the Filestore instance to create, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $filestore = ''; + /** + * Optional. Immutable. Description of the instance. Maximum of 2048 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $description = ''; + /** + * Required. Immutable. File system shares on the instance. Exactly one file + * share must be specified. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.FileShareConfig file_shares = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + private $file_shares; + /** + * Required. Immutable. Service tier to use for the instance. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $tier = 0; + /** + * Optional. Immutable. Access protocol to use for all file shares in the + * instance. Defaults to NFS V3 if not set. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Protocol protocol = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $protocol = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filestore + * Required. Immutable. Name of the Filestore instance to create, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * @type string $description + * Optional. Immutable. Description of the instance. Maximum of 2048 + * characters. + * @type \Google\Cloud\HypercomputeCluster\V1\FileShareConfig[] $file_shares + * Required. Immutable. File system shares on the instance. Exactly one file + * share must be specified. + * @type int $tier + * Required. Immutable. Service tier to use for the instance. + * @type int $protocol + * Optional. Immutable. Access protocol to use for all file shares in the + * instance. Defaults to NFS V3 if not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the Filestore instance to create, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getFilestore() + { + return $this->filestore; + } + + /** + * Required. Immutable. Name of the Filestore instance to create, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string filestore = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setFilestore($var) + { + GPBUtil::checkString($var, True); + $this->filestore = $var; + + return $this; + } + + /** + * Optional. Immutable. Description of the instance. Maximum of 2048 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Immutable. Description of the instance. Maximum of 2048 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. Immutable. File system shares on the instance. Exactly one file + * share must be specified. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.FileShareConfig file_shares = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return RepeatedField<\Google\Cloud\HypercomputeCluster\V1\FileShareConfig> + */ + public function getFileShares() + { + return $this->file_shares; + } + + /** + * Required. Immutable. File system shares on the instance. Exactly one file + * share must be specified. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.FileShareConfig file_shares = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\FileShareConfig[] $var + * @return $this + */ + public function setFileShares($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\FileShareConfig::class); + $this->file_shares = $arr; + + return $this; + } + + /** + * Required. Immutable. Service tier to use for the instance. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getTier() + { + return $this->tier; + } + + /** + * Required. Immutable. Service tier to use for the instance. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Tier tier = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\HypercomputeCluster\V1\NewFilestoreConfig\Tier::class); + $this->tier = $var; + + return $this; + } + + /** + * Optional. Immutable. Access protocol to use for all file shares in the + * instance. Defaults to NFS V3 if not set. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Protocol protocol = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getProtocol() + { + return $this->protocol; + } + + /** + * Optional. Immutable. Access protocol to use for all file shares in the + * instance. Defaults to NFS V3 if not set. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Protocol protocol = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setProtocol($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\HypercomputeCluster\V1\NewFilestoreConfig\Protocol::class); + $this->protocol = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/NewFilestoreConfig/Protocol.php b/HypercomputeCluster/src/V1/NewFilestoreConfig/Protocol.php new file mode 100644 index 000000000000..2e1ba6ee6f91 --- /dev/null +++ b/HypercomputeCluster/src/V1/NewFilestoreConfig/Protocol.php @@ -0,0 +1,61 @@ +google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Protocol + */ +class Protocol +{ + /** + * Not set. + * + * Generated from protobuf enum PROTOCOL_UNSPECIFIED = 0; + */ + const PROTOCOL_UNSPECIFIED = 0; + /** + * NFS 3.0. + * + * Generated from protobuf enum NFSV3 = 1; + */ + const NFSV3 = 1; + /** + * NFS 4.1. + * + * Generated from protobuf enum NFSV41 = 2; + */ + const NFSV41 = 2; + + private static $valueToName = [ + self::PROTOCOL_UNSPECIFIED => 'PROTOCOL_UNSPECIFIED', + self::NFSV3 => 'NFSV3', + self::NFSV41 => 'NFSV41', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/HypercomputeCluster/src/V1/NewFilestoreConfig/Tier.php b/HypercomputeCluster/src/V1/NewFilestoreConfig/Tier.php new file mode 100644 index 000000000000..c6e21fdbf50a --- /dev/null +++ b/HypercomputeCluster/src/V1/NewFilestoreConfig/Tier.php @@ -0,0 +1,65 @@ +google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Tier + */ +class Tier +{ + /** + * Not set. + * + * Generated from protobuf enum TIER_UNSPECIFIED = 0; + */ + const TIER_UNSPECIFIED = 0; + /** + * Offers expanded capacity and performance scaling capabilities suitable + * for high-performance computing application requirements. + * + * Generated from protobuf enum ZONAL = 4; + */ + const ZONAL = 4; + /** + * Offers features and availability needed for mission-critical, + * high-performance computing workloads. + * + * Generated from protobuf enum REGIONAL = 6; + */ + const REGIONAL = 6; + + private static $valueToName = [ + self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', + self::ZONAL => 'ZONAL', + self::REGIONAL => 'REGIONAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/HypercomputeCluster/src/V1/NewFlexStartInstancesConfig.php b/HypercomputeCluster/src/V1/NewFlexStartInstancesConfig.php new file mode 100644 index 000000000000..671fcb89ad68 --- /dev/null +++ b/HypercomputeCluster/src/V1/NewFlexStartInstancesConfig.php @@ -0,0 +1,168 @@ +google.cloud.hypercomputecluster.v1.NewFlexStartInstancesConfig + */ +class NewFlexStartInstancesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $zone = ''; + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $machine_type = ''; + /** + * Required. Immutable. Specifies the time limit for created instances. + * Instances will be terminated at the end of this duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $max_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * @type string $machine_type + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * @type \Google\Protobuf\Duration $max_duration + * Required. Immutable. Specifies the time limit for created instances. + * Instances will be terminated at the end of this duration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Required. Immutable. Specifies the time limit for created instances. + * Instances will be terminated at the end of this duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxDuration() + { + return $this->max_duration; + } + + public function hasMaxDuration() + { + return isset($this->max_duration); + } + + public function clearMaxDuration() + { + unset($this->max_duration); + } + + /** + * Required. Immutable. Specifies the time limit for created instances. + * Instances will be terminated at the end of this duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_duration = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/NewLustreConfig.php b/HypercomputeCluster/src/V1/NewLustreConfig.php new file mode 100644 index 000000000000..01136e18e54c --- /dev/null +++ b/HypercomputeCluster/src/V1/NewLustreConfig.php @@ -0,0 +1,193 @@ +google.cloud.hypercomputecluster.v1.NewLustreConfig + */ +class NewLustreConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the Managed Lustre instance to create, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $lustre = ''; + /** + * Optional. Immutable. Description of the Managed Lustre instance. Maximum of + * 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $description = ''; + /** + * Required. Immutable. Filesystem name for this instance. This name is used + * by client-side tools, including when mounting the instance. Must be 8 + * characters or less and can only contain letters and numbers. + * + * Generated from protobuf field string filesystem = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $filesystem = ''; + /** + * Required. Immutable. Storage capacity of the instance in gibibytes (GiB). + * Allowed values are between 18000 and 7632000. + * + * Generated from protobuf field int64 capacity_gb = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $capacity_gb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $lustre + * Required. Immutable. Name of the Managed Lustre instance to create, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * @type string $description + * Optional. Immutable. Description of the Managed Lustre instance. Maximum of + * 2048 characters. + * @type string $filesystem + * Required. Immutable. Filesystem name for this instance. This name is used + * by client-side tools, including when mounting the instance. Must be 8 + * characters or less and can only contain letters and numbers. + * @type int|string $capacity_gb + * Required. Immutable. Storage capacity of the instance in gibibytes (GiB). + * Allowed values are between 18000 and 7632000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the Managed Lustre instance to create, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getLustre() + { + return $this->lustre; + } + + /** + * Required. Immutable. Name of the Managed Lustre instance to create, in the + * format `projects/{project}/locations/{location}/instances/{instance}` + * + * Generated from protobuf field string lustre = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setLustre($var) + { + GPBUtil::checkString($var, True); + $this->lustre = $var; + + return $this; + } + + /** + * Optional. Immutable. Description of the Managed Lustre instance. Maximum of + * 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Immutable. Description of the Managed Lustre instance. Maximum of + * 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. Immutable. Filesystem name for this instance. This name is used + * by client-side tools, including when mounting the instance. Must be 8 + * characters or less and can only contain letters and numbers. + * + * Generated from protobuf field string filesystem = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getFilesystem() + { + return $this->filesystem; + } + + /** + * Required. Immutable. Filesystem name for this instance. This name is used + * by client-side tools, including when mounting the instance. Must be 8 + * characters or less and can only contain letters and numbers. + * + * Generated from protobuf field string filesystem = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setFilesystem($var) + { + GPBUtil::checkString($var, True); + $this->filesystem = $var; + + return $this; + } + + /** + * Required. Immutable. Storage capacity of the instance in gibibytes (GiB). + * Allowed values are between 18000 and 7632000. + * + * Generated from protobuf field int64 capacity_gb = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int|string + */ + public function getCapacityGb() + { + return $this->capacity_gb; + } + + /** + * Required. Immutable. Storage capacity of the instance in gibibytes (GiB). + * Allowed values are between 18000 and 7632000. + * + * Generated from protobuf field int64 capacity_gb = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int|string $var + * @return $this + */ + public function setCapacityGb($var) + { + GPBUtil::checkInt64($var); + $this->capacity_gb = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/NewNetworkConfig.php b/HypercomputeCluster/src/V1/NewNetworkConfig.php new file mode 100644 index 000000000000..7472f88b34b4 --- /dev/null +++ b/HypercomputeCluster/src/V1/NewNetworkConfig.php @@ -0,0 +1,111 @@ +google.cloud.hypercomputecluster.v1.NewNetworkConfig + */ +class NewNetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the network to create, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Optional. Immutable. Description of the network. Maximum of 2048 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Required. Immutable. Name of the network to create, in the format + * `projects/{project}/global/networks/{network}`. + * @type string $description + * Optional. Immutable. Description of the network. Maximum of 2048 + * characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the network to create, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. Immutable. Name of the network to create, in the format + * `projects/{project}/global/networks/{network}`. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. Immutable. Description of the network. Maximum of 2048 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Immutable. Description of the network. Maximum of 2048 + * characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/NewOnDemandInstancesConfig.php b/HypercomputeCluster/src/V1/NewOnDemandInstancesConfig.php new file mode 100644 index 000000000000..9d51331bca89 --- /dev/null +++ b/HypercomputeCluster/src/V1/NewOnDemandInstancesConfig.php @@ -0,0 +1,120 @@ +google.cloud.hypercomputecluster.v1.NewOnDemandInstancesConfig + */ +class NewOnDemandInstancesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $zone = ''; + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $machine_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * @type string $machine_type + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/NewReservedInstancesConfig.php b/HypercomputeCluster/src/V1/NewReservedInstancesConfig.php new file mode 100644 index 000000000000..f32efea2149b --- /dev/null +++ b/HypercomputeCluster/src/V1/NewReservedInstancesConfig.php @@ -0,0 +1,84 @@ +google.cloud.hypercomputecluster.v1.NewReservedInstancesConfig + */ +class NewReservedInstancesConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reservation + * Optional. Immutable. Name of the reservation from which VM instances + * should be created, in the format + * `projects/{project}/zones/{zone}/reservations/{reservation}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Immutable. Name of the reservation from which VM instances + * should be created, in the format + * `projects/{project}/zones/{zone}/reservations/{reservation}`. + * + * Generated from protobuf field string reservation = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getReservation() + { + return $this->readOneof(1); + } + + public function hasReservation() + { + return $this->hasOneof(1); + } + + /** + * Optional. Immutable. Name of the reservation from which VM instances + * should be created, in the format + * `projects/{project}/zones/{zone}/reservations/{reservation}`. + * + * Generated from protobuf field string reservation = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setReservation($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/HypercomputeCluster/src/V1/NewSpotInstancesConfig.php b/HypercomputeCluster/src/V1/NewSpotInstancesConfig.php new file mode 100644 index 000000000000..377bd9f2dfe9 --- /dev/null +++ b/HypercomputeCluster/src/V1/NewSpotInstancesConfig.php @@ -0,0 +1,159 @@ +google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig + */ +class NewSpotInstancesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $zone = ''; + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $machine_type = ''; + /** + * Optional. Termination action for the instance. If not specified, Compute + * Engine sets the termination action to DELETE. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig.TerminationAction termination_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $termination_action = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * @type string $machine_type + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * @type int $termination_action + * Optional. Termination action for the instance. If not specified, Compute + * Engine sets the termination action to DELETE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Required. Immutable. Name of the zone in which VM instances should run, + * e.g., `us-central1-a`. Must be in the same region as the cluster, and must + * match the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * Required. Immutable. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g. + * `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Optional. Termination action for the instance. If not specified, Compute + * Engine sets the termination action to DELETE. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig.TerminationAction termination_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTerminationAction() + { + return $this->termination_action; + } + + /** + * Optional. Termination action for the instance. If not specified, Compute + * Engine sets the termination action to DELETE. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig.TerminationAction termination_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTerminationAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\HypercomputeCluster\V1\NewSpotInstancesConfig\TerminationAction::class); + $this->termination_action = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/NewSpotInstancesConfig/TerminationAction.php b/HypercomputeCluster/src/V1/NewSpotInstancesConfig/TerminationAction.php new file mode 100644 index 000000000000..9ceec9b4263b --- /dev/null +++ b/HypercomputeCluster/src/V1/NewSpotInstancesConfig/TerminationAction.php @@ -0,0 +1,61 @@ +google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig.TerminationAction + */ +class TerminationAction +{ + /** + * Not set. + * + * Generated from protobuf enum TERMINATION_ACTION_UNSPECIFIED = 0; + */ + const TERMINATION_ACTION_UNSPECIFIED = 0; + /** + * Compute Engine stops the Spot VM on preemption. + * + * Generated from protobuf enum STOP = 1; + */ + const STOP = 1; + /** + * Compute Engine deletes the Spot VM on preemption. + * + * Generated from protobuf enum DELETE = 2; + */ + const DELETE = 2; + + private static $valueToName = [ + self::TERMINATION_ACTION_UNSPECIFIED => 'TERMINATION_ACTION_UNSPECIFIED', + self::STOP => 'STOP', + self::DELETE => 'DELETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/HypercomputeCluster/src/V1/OperationMetadata.php b/HypercomputeCluster/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..b60e2c617cef --- /dev/null +++ b/HypercomputeCluster/src/V1/OperationMetadata.php @@ -0,0 +1,321 @@ +google.cloud.hypercomputecluster.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + /** + * Output only. Progress of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.OperationProgress progress = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $progress = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`, + * corresponding to `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\OperationProgress $progress + * Output only. Progress of the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + + /** + * Output only. Progress of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.OperationProgress progress = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\OperationProgress|null + */ + public function getProgress() + { + return $this->progress; + } + + public function hasProgress() + { + return isset($this->progress); + } + + public function clearProgress() + { + unset($this->progress); + } + + /** + * Output only. Progress of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.OperationProgress progress = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\OperationProgress $var + * @return $this + */ + public function setProgress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\OperationProgress::class); + $this->progress = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/OperationProgress.php b/HypercomputeCluster/src/V1/OperationProgress.php new file mode 100644 index 000000000000..89f0a3147358 --- /dev/null +++ b/HypercomputeCluster/src/V1/OperationProgress.php @@ -0,0 +1,67 @@ +google.cloud.hypercomputecluster.v1.OperationProgress + */ +class OperationProgress extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Steps and status of the operation. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.OperationStep steps = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $steps; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\OperationStep[] $steps + * Output only. Steps and status of the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Steps and status of the operation. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.OperationStep steps = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\HypercomputeCluster\V1\OperationStep> + */ + public function getSteps() + { + return $this->steps; + } + + /** + * Output only. Steps and status of the operation. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.OperationStep steps = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\OperationStep[] $var + * @return $this + */ + public function setSteps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\OperationStep::class); + $this->steps = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/OperationStep.php b/HypercomputeCluster/src/V1/OperationStep.php new file mode 100644 index 000000000000..7c1df4b643a5 --- /dev/null +++ b/HypercomputeCluster/src/V1/OperationStep.php @@ -0,0 +1,905 @@ +google.cloud.hypercomputecluster.v1.OperationStep + */ +class OperationStep extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. State of the operation step. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.OperationStep.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\CreateNetwork $create_network + * Output only. If set, indicates that new network creation is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CreatePrivateServiceAccess $create_private_service_access + * Output only. If set, indicates that new private service access creation + * is part of the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CreateFilestoreInstance $create_filestore_instance + * Output only. If set, indicates that new Filestore instance creation is + * part of the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CreateStorageBucket $create_storage_bucket + * Output only. If set, indicates that new Cloud Storage bucket creation is + * part of the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CreateLustreInstance $create_lustre_instance + * Output only. If set, indicates that new Lustre instance creation is part + * of the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CreateOrchestrator $create_orchestrator + * Output only. If set, indicates that orchestrator creation is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CreateNodeset $create_nodeset + * Output only. If set, indicates that new nodeset creation is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CreatePartition $create_partition + * Output only. If set, indicates that new partition creation is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CreateLoginNode $create_login_node + * Output only. If set, indicates that new login node creation is part of + * the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\CheckClusterHealth $check_cluster_health + * Output only. If set, indicates that cluster health check is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\UpdateOrchestrator $update_orchestrator + * Output only. If set, indicates that an orchestrator update is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\UpdateNodeset $update_nodeset + * Output only. If set, indicates that nodeset update is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\UpdatePartition $update_partition + * Output only. If set, indicates that partition update is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\UpdateLoginNode $update_login_node + * Output only. If set, indicates that login node update is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeleteOrchestrator $delete_orchestrator + * Output only. If set, indicates that orchestrator deletion is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeleteNodeset $delete_nodeset + * Output only. If set, indicates that nodeset deletion is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeletePartition $delete_partition + * Output only. If set, indicates that partition deletion is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeleteLoginNode $delete_login_node + * Output only. If set, indicates that login node deletion is part of the + * operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeleteFilestoreInstance $delete_filestore_instance + * Output only. If set, indicates that Filestore instance deletion is part + * of the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeleteStorageBucket $delete_storage_bucket + * Output only. If set, indicates that Cloud Storage bucket deletion is part + * of the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeleteLustreInstance $delete_lustre_instance + * Output only. If set, indicates that Lustre instance deletion is part of + * the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeletePrivateServiceAccess $delete_private_service_access + * Output only. If set, indicates that private service access deletion is + * part of the operation. + * @type \Google\Cloud\HypercomputeCluster\V1\DeleteNetwork $delete_network + * Output only. If set, indicates that network deletion is part of the + * operation. + * @type int $state + * Output only. State of the operation step. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. If set, indicates that new network creation is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateNetwork create_network = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreateNetwork|null + */ + public function getCreateNetwork() + { + return $this->readOneof(2); + } + + public function hasCreateNetwork() + { + return $this->hasOneof(2); + } + + /** + * Output only. If set, indicates that new network creation is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateNetwork create_network = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreateNetwork $var + * @return $this + */ + public function setCreateNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreateNetwork::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Output only. If set, indicates that new private service access creation + * is part of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreatePrivateServiceAccess create_private_service_access = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreatePrivateServiceAccess|null + */ + public function getCreatePrivateServiceAccess() + { + return $this->readOneof(3); + } + + public function hasCreatePrivateServiceAccess() + { + return $this->hasOneof(3); + } + + /** + * Output only. If set, indicates that new private service access creation + * is part of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreatePrivateServiceAccess create_private_service_access = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreatePrivateServiceAccess $var + * @return $this + */ + public function setCreatePrivateServiceAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreatePrivateServiceAccess::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. If set, indicates that new Filestore instance creation is + * part of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateFilestoreInstance create_filestore_instance = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreateFilestoreInstance|null + */ + public function getCreateFilestoreInstance() + { + return $this->readOneof(4); + } + + public function hasCreateFilestoreInstance() + { + return $this->hasOneof(4); + } + + /** + * Output only. If set, indicates that new Filestore instance creation is + * part of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateFilestoreInstance create_filestore_instance = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreateFilestoreInstance $var + * @return $this + */ + public function setCreateFilestoreInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreateFilestoreInstance::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output only. If set, indicates that new Cloud Storage bucket creation is + * part of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateStorageBucket create_storage_bucket = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreateStorageBucket|null + */ + public function getCreateStorageBucket() + { + return $this->readOneof(5); + } + + public function hasCreateStorageBucket() + { + return $this->hasOneof(5); + } + + /** + * Output only. If set, indicates that new Cloud Storage bucket creation is + * part of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateStorageBucket create_storage_bucket = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreateStorageBucket $var + * @return $this + */ + public function setCreateStorageBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreateStorageBucket::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. If set, indicates that new Lustre instance creation is part + * of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateLustreInstance create_lustre_instance = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreateLustreInstance|null + */ + public function getCreateLustreInstance() + { + return $this->readOneof(6); + } + + public function hasCreateLustreInstance() + { + return $this->hasOneof(6); + } + + /** + * Output only. If set, indicates that new Lustre instance creation is part + * of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateLustreInstance create_lustre_instance = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreateLustreInstance $var + * @return $this + */ + public function setCreateLustreInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreateLustreInstance::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. If set, indicates that orchestrator creation is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateOrchestrator create_orchestrator = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreateOrchestrator|null + */ + public function getCreateOrchestrator() + { + return $this->readOneof(8); + } + + public function hasCreateOrchestrator() + { + return $this->hasOneof(8); + } + + /** + * Output only. If set, indicates that orchestrator creation is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateOrchestrator create_orchestrator = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreateOrchestrator $var + * @return $this + */ + public function setCreateOrchestrator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreateOrchestrator::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Output only. If set, indicates that new nodeset creation is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateNodeset create_nodeset = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreateNodeset|null + */ + public function getCreateNodeset() + { + return $this->readOneof(9); + } + + public function hasCreateNodeset() + { + return $this->hasOneof(9); + } + + /** + * Output only. If set, indicates that new nodeset creation is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateNodeset create_nodeset = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreateNodeset $var + * @return $this + */ + public function setCreateNodeset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreateNodeset::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Output only. If set, indicates that new partition creation is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreatePartition create_partition = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreatePartition|null + */ + public function getCreatePartition() + { + return $this->readOneof(10); + } + + public function hasCreatePartition() + { + return $this->hasOneof(10); + } + + /** + * Output only. If set, indicates that new partition creation is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreatePartition create_partition = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreatePartition $var + * @return $this + */ + public function setCreatePartition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreatePartition::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Output only. If set, indicates that new login node creation is part of + * the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateLoginNode create_login_node = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CreateLoginNode|null + */ + public function getCreateLoginNode() + { + return $this->readOneof(11); + } + + public function hasCreateLoginNode() + { + return $this->hasOneof(11); + } + + /** + * Output only. If set, indicates that new login node creation is part of + * the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CreateLoginNode create_login_node = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CreateLoginNode $var + * @return $this + */ + public function setCreateLoginNode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CreateLoginNode::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Output only. If set, indicates that cluster health check is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CheckClusterHealth check_cluster_health = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\CheckClusterHealth|null + */ + public function getCheckClusterHealth() + { + return $this->readOneof(12); + } + + public function hasCheckClusterHealth() + { + return $this->hasOneof(12); + } + + /** + * Output only. If set, indicates that cluster health check is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.CheckClusterHealth check_cluster_health = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\CheckClusterHealth $var + * @return $this + */ + public function setCheckClusterHealth($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\CheckClusterHealth::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Output only. If set, indicates that an orchestrator update is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.UpdateOrchestrator update_orchestrator = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\UpdateOrchestrator|null + */ + public function getUpdateOrchestrator() + { + return $this->readOneof(13); + } + + public function hasUpdateOrchestrator() + { + return $this->hasOneof(13); + } + + /** + * Output only. If set, indicates that an orchestrator update is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.UpdateOrchestrator update_orchestrator = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\UpdateOrchestrator $var + * @return $this + */ + public function setUpdateOrchestrator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\UpdateOrchestrator::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Output only. If set, indicates that nodeset update is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.UpdateNodeset update_nodeset = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\UpdateNodeset|null + */ + public function getUpdateNodeset() + { + return $this->readOneof(14); + } + + public function hasUpdateNodeset() + { + return $this->hasOneof(14); + } + + /** + * Output only. If set, indicates that nodeset update is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.UpdateNodeset update_nodeset = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\UpdateNodeset $var + * @return $this + */ + public function setUpdateNodeset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\UpdateNodeset::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Output only. If set, indicates that partition update is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.UpdatePartition update_partition = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\UpdatePartition|null + */ + public function getUpdatePartition() + { + return $this->readOneof(15); + } + + public function hasUpdatePartition() + { + return $this->hasOneof(15); + } + + /** + * Output only. If set, indicates that partition update is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.UpdatePartition update_partition = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\UpdatePartition $var + * @return $this + */ + public function setUpdatePartition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\UpdatePartition::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Output only. If set, indicates that login node update is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.UpdateLoginNode update_login_node = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\UpdateLoginNode|null + */ + public function getUpdateLoginNode() + { + return $this->readOneof(16); + } + + public function hasUpdateLoginNode() + { + return $this->hasOneof(16); + } + + /** + * Output only. If set, indicates that login node update is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.UpdateLoginNode update_login_node = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\UpdateLoginNode $var + * @return $this + */ + public function setUpdateLoginNode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\UpdateLoginNode::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Output only. If set, indicates that orchestrator deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteOrchestrator delete_orchestrator = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeleteOrchestrator|null + */ + public function getDeleteOrchestrator() + { + return $this->readOneof(18); + } + + public function hasDeleteOrchestrator() + { + return $this->hasOneof(18); + } + + /** + * Output only. If set, indicates that orchestrator deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteOrchestrator delete_orchestrator = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeleteOrchestrator $var + * @return $this + */ + public function setDeleteOrchestrator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeleteOrchestrator::class); + $this->writeOneof(18, $var); + + return $this; + } + + /** + * Output only. If set, indicates that nodeset deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteNodeset delete_nodeset = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeleteNodeset|null + */ + public function getDeleteNodeset() + { + return $this->readOneof(19); + } + + public function hasDeleteNodeset() + { + return $this->hasOneof(19); + } + + /** + * Output only. If set, indicates that nodeset deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteNodeset delete_nodeset = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeleteNodeset $var + * @return $this + */ + public function setDeleteNodeset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeleteNodeset::class); + $this->writeOneof(19, $var); + + return $this; + } + + /** + * Output only. If set, indicates that partition deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeletePartition delete_partition = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeletePartition|null + */ + public function getDeletePartition() + { + return $this->readOneof(20); + } + + public function hasDeletePartition() + { + return $this->hasOneof(20); + } + + /** + * Output only. If set, indicates that partition deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeletePartition delete_partition = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeletePartition $var + * @return $this + */ + public function setDeletePartition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeletePartition::class); + $this->writeOneof(20, $var); + + return $this; + } + + /** + * Output only. If set, indicates that login node deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteLoginNode delete_login_node = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeleteLoginNode|null + */ + public function getDeleteLoginNode() + { + return $this->readOneof(21); + } + + public function hasDeleteLoginNode() + { + return $this->hasOneof(21); + } + + /** + * Output only. If set, indicates that login node deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteLoginNode delete_login_node = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeleteLoginNode $var + * @return $this + */ + public function setDeleteLoginNode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeleteLoginNode::class); + $this->writeOneof(21, $var); + + return $this; + } + + /** + * Output only. If set, indicates that Filestore instance deletion is part + * of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteFilestoreInstance delete_filestore_instance = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeleteFilestoreInstance|null + */ + public function getDeleteFilestoreInstance() + { + return $this->readOneof(22); + } + + public function hasDeleteFilestoreInstance() + { + return $this->hasOneof(22); + } + + /** + * Output only. If set, indicates that Filestore instance deletion is part + * of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteFilestoreInstance delete_filestore_instance = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeleteFilestoreInstance $var + * @return $this + */ + public function setDeleteFilestoreInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeleteFilestoreInstance::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Output only. If set, indicates that Cloud Storage bucket deletion is part + * of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteStorageBucket delete_storage_bucket = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeleteStorageBucket|null + */ + public function getDeleteStorageBucket() + { + return $this->readOneof(23); + } + + public function hasDeleteStorageBucket() + { + return $this->hasOneof(23); + } + + /** + * Output only. If set, indicates that Cloud Storage bucket deletion is part + * of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteStorageBucket delete_storage_bucket = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeleteStorageBucket $var + * @return $this + */ + public function setDeleteStorageBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeleteStorageBucket::class); + $this->writeOneof(23, $var); + + return $this; + } + + /** + * Output only. If set, indicates that Lustre instance deletion is part of + * the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteLustreInstance delete_lustre_instance = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeleteLustreInstance|null + */ + public function getDeleteLustreInstance() + { + return $this->readOneof(24); + } + + public function hasDeleteLustreInstance() + { + return $this->hasOneof(24); + } + + /** + * Output only. If set, indicates that Lustre instance deletion is part of + * the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteLustreInstance delete_lustre_instance = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeleteLustreInstance $var + * @return $this + */ + public function setDeleteLustreInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeleteLustreInstance::class); + $this->writeOneof(24, $var); + + return $this; + } + + /** + * Output only. If set, indicates that private service access deletion is + * part of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeletePrivateServiceAccess delete_private_service_access = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeletePrivateServiceAccess|null + */ + public function getDeletePrivateServiceAccess() + { + return $this->readOneof(25); + } + + public function hasDeletePrivateServiceAccess() + { + return $this->hasOneof(25); + } + + /** + * Output only. If set, indicates that private service access deletion is + * part of the operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeletePrivateServiceAccess delete_private_service_access = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeletePrivateServiceAccess $var + * @return $this + */ + public function setDeletePrivateServiceAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeletePrivateServiceAccess::class); + $this->writeOneof(25, $var); + + return $this; + } + + /** + * Output only. If set, indicates that network deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteNetwork delete_network = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\HypercomputeCluster\V1\DeleteNetwork|null + */ + public function getDeleteNetwork() + { + return $this->readOneof(26); + } + + public function hasDeleteNetwork() + { + return $this->hasOneof(26); + } + + /** + * Output only. If set, indicates that network deletion is part of the + * operation. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.DeleteNetwork delete_network = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\DeleteNetwork $var + * @return $this + */ + public function setDeleteNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\DeleteNetwork::class); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * Output only. State of the operation step. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.OperationStep.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the operation step. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.OperationStep.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\HypercomputeCluster\V1\OperationStep\State::class); + $this->state = $var; + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + diff --git a/HypercomputeCluster/src/V1/OperationStep/State.php b/HypercomputeCluster/src/V1/OperationStep/State.php new file mode 100644 index 000000000000..cb5decca48a2 --- /dev/null +++ b/HypercomputeCluster/src/V1/OperationStep/State.php @@ -0,0 +1,68 @@ +google.cloud.hypercomputecluster.v1.OperationStep.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Initial state before step execution starts. + * + * Generated from protobuf enum WAITING = 1; + */ + const WAITING = 1; + /** + * Step execution is running in progress. + * + * Generated from protobuf enum IN_PROGRESS = 2; + */ + const IN_PROGRESS = 2; + /** + * Step execution is completed. + * + * Generated from protobuf enum DONE = 3; + */ + const DONE = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::WAITING => 'WAITING', + self::IN_PROGRESS => 'IN_PROGRESS', + self::DONE => 'DONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/HypercomputeCluster/src/V1/Orchestrator.php b/HypercomputeCluster/src/V1/Orchestrator.php new file mode 100644 index 000000000000..55f6defb9871 --- /dev/null +++ b/HypercomputeCluster/src/V1/Orchestrator.php @@ -0,0 +1,80 @@ +google.cloud.hypercomputecluster.v1.Orchestrator + */ +class Orchestrator extends \Google\Protobuf\Internal\Message +{ + protected $option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\SlurmOrchestrator $slurm + * Optional. If set, indicates that the cluster should use Slurm as the + * orchestrator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If set, indicates that the cluster should use Slurm as the + * orchestrator. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.SlurmOrchestrator slurm = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\HypercomputeCluster\V1\SlurmOrchestrator|null + */ + public function getSlurm() + { + return $this->readOneof(1); + } + + public function hasSlurm() + { + return $this->hasOneof(1); + } + + /** + * Optional. If set, indicates that the cluster should use Slurm as the + * orchestrator. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.SlurmOrchestrator slurm = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\SlurmOrchestrator $var + * @return $this + */ + public function setSlurm($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\SlurmOrchestrator::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getOption() + { + return $this->whichOneof("option"); + } + +} + diff --git a/HypercomputeCluster/src/V1/SlurmLoginNodes.php b/HypercomputeCluster/src/V1/SlurmLoginNodes.php new file mode 100644 index 000000000000..82be06f41b63 --- /dev/null +++ b/HypercomputeCluster/src/V1/SlurmLoginNodes.php @@ -0,0 +1,450 @@ +google.cloud.hypercomputecluster.v1.SlurmLoginNodes + */ +class SlurmLoginNodes extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Number of login node instances to create. + * + * Generated from protobuf field int64 count = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $count = 0; + /** + * Required. Name of the zone in which login nodes should run, e.g., + * `us-central1-a`. Must be in the same region as the cluster, and must match + * the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + /** + * Required. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use for + * login nodes, e.g. `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $machine_type = ''; + /** + * Optional. [Startup + * script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux) + * to be run on each login node instance. Max 256KB. + * The script must complete within the system-defined default timeout of 5 + * minutes. For tasks that require more time, consider running them in the + * background using methods such as `&` or `nohup`. + * + * Generated from protobuf field string startup_script = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $startup_script = ''; + /** + * Optional. Whether [OS Login](https://cloud.google.com/compute/docs/oslogin) + * should be enabled on login node instances. + * + * Generated from protobuf field bool enable_os_login = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_os_login = false; + /** + * Optional. Whether login node instances should be assigned [external IP + * addresses](https://cloud.google.com/compute/docs/ip-addresses#externaladdresses). + * + * Generated from protobuf field bool enable_public_ips = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_public_ips = false; + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) that + * should be applied to each login node instance. + * + * Generated from protobuf field map labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. How [storage + * resources][google.cloud.hypercomputecluster.v1.StorageResource] should be + * mounted on each login node. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.StorageConfig storage_configs = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $storage_configs; + /** + * Output only. Information about the login node instances that were created + * in Compute Engine. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.ComputeInstance instances = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $instances; + /** + * Optional. Boot disk for the login node. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.BootDisk boot_disk = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $count + * Required. Number of login node instances to create. + * @type string $zone + * Required. Name of the zone in which login nodes should run, e.g., + * `us-central1-a`. Must be in the same region as the cluster, and must match + * the zone of any other resources specified in the cluster. + * @type string $machine_type + * Required. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use for + * login nodes, e.g. `n2-standard-2`. + * @type string $startup_script + * Optional. [Startup + * script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux) + * to be run on each login node instance. Max 256KB. + * The script must complete within the system-defined default timeout of 5 + * minutes. For tasks that require more time, consider running them in the + * background using methods such as `&` or `nohup`. + * @type bool $enable_os_login + * Optional. Whether [OS Login](https://cloud.google.com/compute/docs/oslogin) + * should be enabled on login node instances. + * @type bool $enable_public_ips + * Optional. Whether login node instances should be assigned [external IP + * addresses](https://cloud.google.com/compute/docs/ip-addresses#externaladdresses). + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) that + * should be applied to each login node instance. + * @type \Google\Cloud\HypercomputeCluster\V1\StorageConfig[] $storage_configs + * Optional. How [storage + * resources][google.cloud.hypercomputecluster.v1.StorageResource] should be + * mounted on each login node. + * @type \Google\Cloud\HypercomputeCluster\V1\ComputeInstance[] $instances + * Output only. Information about the login node instances that were created + * in Compute Engine. + * @type \Google\Cloud\HypercomputeCluster\V1\BootDisk $boot_disk + * Optional. Boot disk for the login node. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Number of login node instances to create. + * + * Generated from protobuf field int64 count = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * Required. Number of login node instances to create. + * + * Generated from protobuf field int64 count = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt64($var); + $this->count = $var; + + return $this; + } + + /** + * Required. Name of the zone in which login nodes should run, e.g., + * `us-central1-a`. Must be in the same region as the cluster, and must match + * the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Required. Name of the zone in which login nodes should run, e.g., + * `us-central1-a`. Must be in the same region as the cluster, and must match + * the zone of any other resources specified in the cluster. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * Required. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use for + * login nodes, e.g. `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * Required. Name of the Compute Engine [machine + * type](https://cloud.google.com/compute/docs/machine-resource) to use for + * login nodes, e.g. `n2-standard-2`. + * + * Generated from protobuf field string machine_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Optional. [Startup + * script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux) + * to be run on each login node instance. Max 256KB. + * The script must complete within the system-defined default timeout of 5 + * minutes. For tasks that require more time, consider running them in the + * background using methods such as `&` or `nohup`. + * + * Generated from protobuf field string startup_script = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getStartupScript() + { + return $this->startup_script; + } + + /** + * Optional. [Startup + * script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux) + * to be run on each login node instance. Max 256KB. + * The script must complete within the system-defined default timeout of 5 + * minutes. For tasks that require more time, consider running them in the + * background using methods such as `&` or `nohup`. + * + * Generated from protobuf field string startup_script = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setStartupScript($var) + { + GPBUtil::checkString($var, True); + $this->startup_script = $var; + + return $this; + } + + /** + * Optional. Whether [OS Login](https://cloud.google.com/compute/docs/oslogin) + * should be enabled on login node instances. + * + * Generated from protobuf field bool enable_os_login = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableOsLogin() + { + return $this->enable_os_login; + } + + /** + * Optional. Whether [OS Login](https://cloud.google.com/compute/docs/oslogin) + * should be enabled on login node instances. + * + * Generated from protobuf field bool enable_os_login = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableOsLogin($var) + { + GPBUtil::checkBool($var); + $this->enable_os_login = $var; + + return $this; + } + + /** + * Optional. Whether login node instances should be assigned [external IP + * addresses](https://cloud.google.com/compute/docs/ip-addresses#externaladdresses). + * + * Generated from protobuf field bool enable_public_ips = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnablePublicIps() + { + return $this->enable_public_ips; + } + + /** + * Optional. Whether login node instances should be assigned [external IP + * addresses](https://cloud.google.com/compute/docs/ip-addresses#externaladdresses). + * + * Generated from protobuf field bool enable_public_ips = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnablePublicIps($var) + { + GPBUtil::checkBool($var); + $this->enable_public_ips = $var; + + return $this; + } + + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) that + * should be applied to each login node instance. + * + * Generated from protobuf field map labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. + * [Labels](https://cloud.google.com/compute/docs/labeling-resources) that + * should be applied to each login node instance. + * + * Generated from protobuf field map labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. How [storage + * resources][google.cloud.hypercomputecluster.v1.StorageResource] should be + * mounted on each login node. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.StorageConfig storage_configs = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\HypercomputeCluster\V1\StorageConfig> + */ + public function getStorageConfigs() + { + return $this->storage_configs; + } + + /** + * Optional. How [storage + * resources][google.cloud.hypercomputecluster.v1.StorageResource] should be + * mounted on each login node. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.StorageConfig storage_configs = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\StorageConfig[] $var + * @return $this + */ + public function setStorageConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\StorageConfig::class); + $this->storage_configs = $arr; + + return $this; + } + + /** + * Output only. Information about the login node instances that were created + * in Compute Engine. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.ComputeInstance instances = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\HypercomputeCluster\V1\ComputeInstance> + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Output only. Information about the login node instances that were created + * in Compute Engine. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.ComputeInstance instances = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\HypercomputeCluster\V1\ComputeInstance[] $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\ComputeInstance::class); + $this->instances = $arr; + + return $this; + } + + /** + * Optional. Boot disk for the login node. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.BootDisk boot_disk = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\HypercomputeCluster\V1\BootDisk|null + */ + public function getBootDisk() + { + return $this->boot_disk; + } + + public function hasBootDisk() + { + return isset($this->boot_disk); + } + + public function clearBootDisk() + { + unset($this->boot_disk); + } + + /** + * Optional. Boot disk for the login node. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.BootDisk boot_disk = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\BootDisk $var + * @return $this + */ + public function setBootDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\BootDisk::class); + $this->boot_disk = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/SlurmNodeSet.php b/HypercomputeCluster/src/V1/SlurmNodeSet.php new file mode 100644 index 000000000000..8853627e478c --- /dev/null +++ b/HypercomputeCluster/src/V1/SlurmNodeSet.php @@ -0,0 +1,302 @@ +google.cloud.hypercomputecluster.v1.SlurmNodeSet + */ +class SlurmNodeSet extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Identifier for the nodeset, which allows it to be referenced by + * partitions. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $id = ''; + /** + * Optional. ID of the compute resource on which this nodeset will run. Must + * match a key in the cluster's + * [compute_resources][google.cloud.hypercomputecluster.v1.Cluster.compute_resources]. + * + * Generated from protobuf field string compute_id = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $compute_id = ''; + /** + * Optional. How [storage + * resources][google.cloud.hypercomputecluster.v1.StorageResource] should be + * mounted on each compute node. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.StorageConfig storage_configs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $storage_configs; + /** + * Optional. Number of nodes to be statically created for this nodeset. The + * cluster will attempt to ensure that at least this many nodes exist at all + * times. + * + * Generated from protobuf field int64 static_node_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $static_node_count = 0; + /** + * Optional. Controls how many additional nodes a cluster can bring online to + * handle workloads. Set this value to enable dynamic node creation and limit + * the number of additional nodes the cluster can bring online. Leave empty if + * you do not want the cluster to create nodes dynamically, and instead rely + * only on static nodes. + * + * Generated from protobuf field int64 max_dynamic_node_count = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_dynamic_node_count = 0; + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\ComputeInstanceSlurmNodeSet $compute_instance + * Optional. If set, indicates that the nodeset should be backed by Compute + * Engine instances. + * @type string $id + * Required. Identifier for the nodeset, which allows it to be referenced by + * partitions. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * @type string $compute_id + * Optional. ID of the compute resource on which this nodeset will run. Must + * match a key in the cluster's + * [compute_resources][google.cloud.hypercomputecluster.v1.Cluster.compute_resources]. + * @type \Google\Cloud\HypercomputeCluster\V1\StorageConfig[] $storage_configs + * Optional. How [storage + * resources][google.cloud.hypercomputecluster.v1.StorageResource] should be + * mounted on each compute node. + * @type int|string $static_node_count + * Optional. Number of nodes to be statically created for this nodeset. The + * cluster will attempt to ensure that at least this many nodes exist at all + * times. + * @type int|string $max_dynamic_node_count + * Optional. Controls how many additional nodes a cluster can bring online to + * handle workloads. Set this value to enable dynamic node creation and limit + * the number of additional nodes the cluster can bring online. Leave empty if + * you do not want the cluster to create nodes dynamically, and instead rely + * only on static nodes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If set, indicates that the nodeset should be backed by Compute + * Engine instances. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet compute_instance = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\HypercomputeCluster\V1\ComputeInstanceSlurmNodeSet|null + */ + public function getComputeInstance() + { + return $this->readOneof(17); + } + + public function hasComputeInstance() + { + return $this->hasOneof(17); + } + + /** + * Optional. If set, indicates that the nodeset should be backed by Compute + * Engine instances. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet compute_instance = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\ComputeInstanceSlurmNodeSet $var + * @return $this + */ + public function setComputeInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\ComputeInstanceSlurmNodeSet::class); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * Required. Identifier for the nodeset, which allows it to be referenced by + * partitions. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. Identifier for the nodeset, which allows it to be referenced by + * partitions. Must conform to + * [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + * alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Optional. ID of the compute resource on which this nodeset will run. Must + * match a key in the cluster's + * [compute_resources][google.cloud.hypercomputecluster.v1.Cluster.compute_resources]. + * + * Generated from protobuf field string compute_id = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getComputeId() + { + return $this->compute_id; + } + + /** + * Optional. ID of the compute resource on which this nodeset will run. Must + * match a key in the cluster's + * [compute_resources][google.cloud.hypercomputecluster.v1.Cluster.compute_resources]. + * + * Generated from protobuf field string compute_id = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setComputeId($var) + { + GPBUtil::checkString($var, True); + $this->compute_id = $var; + + return $this; + } + + /** + * Optional. How [storage + * resources][google.cloud.hypercomputecluster.v1.StorageResource] should be + * mounted on each compute node. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.StorageConfig storage_configs = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\HypercomputeCluster\V1\StorageConfig> + */ + public function getStorageConfigs() + { + return $this->storage_configs; + } + + /** + * Optional. How [storage + * resources][google.cloud.hypercomputecluster.v1.StorageResource] should be + * mounted on each compute node. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.StorageConfig storage_configs = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\StorageConfig[] $var + * @return $this + */ + public function setStorageConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\StorageConfig::class); + $this->storage_configs = $arr; + + return $this; + } + + /** + * Optional. Number of nodes to be statically created for this nodeset. The + * cluster will attempt to ensure that at least this many nodes exist at all + * times. + * + * Generated from protobuf field int64 static_node_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getStaticNodeCount() + { + return $this->static_node_count; + } + + /** + * Optional. Number of nodes to be statically created for this nodeset. The + * cluster will attempt to ensure that at least this many nodes exist at all + * times. + * + * Generated from protobuf field int64 static_node_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setStaticNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->static_node_count = $var; + + return $this; + } + + /** + * Optional. Controls how many additional nodes a cluster can bring online to + * handle workloads. Set this value to enable dynamic node creation and limit + * the number of additional nodes the cluster can bring online. Leave empty if + * you do not want the cluster to create nodes dynamically, and instead rely + * only on static nodes. + * + * Generated from protobuf field int64 max_dynamic_node_count = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getMaxDynamicNodeCount() + { + return $this->max_dynamic_node_count; + } + + /** + * Optional. Controls how many additional nodes a cluster can bring online to + * handle workloads. Set this value to enable dynamic node creation and limit + * the number of additional nodes the cluster can bring online. Leave empty if + * you do not want the cluster to create nodes dynamically, and instead rely + * only on static nodes. + * + * Generated from protobuf field int64 max_dynamic_node_count = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setMaxDynamicNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->max_dynamic_node_count = $var; + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + diff --git a/HypercomputeCluster/src/V1/SlurmOrchestrator.php b/HypercomputeCluster/src/V1/SlurmOrchestrator.php new file mode 100644 index 000000000000..7571b533de5b --- /dev/null +++ b/HypercomputeCluster/src/V1/SlurmOrchestrator.php @@ -0,0 +1,301 @@ +google.cloud.hypercomputecluster.v1.SlurmOrchestrator + */ +class SlurmOrchestrator extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Configuration for login nodes, which allow users to access the + * cluster over SSH. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.SlurmLoginNodes login_nodes = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $login_nodes = null; + /** + * Optional. Compute resource configuration for the Slurm nodesets in your + * cluster. If not specified, the cluster won't create any nodes. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.SlurmNodeSet node_sets = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $node_sets; + /** + * Optional. Configuration for the Slurm partitions in your cluster. Each + * partition can contain one or more nodesets, and you can submit separate + * jobs on each partition. If you don't specify at least one partition in your + * cluster, you can't submit jobs to the cluster. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.SlurmPartition partitions = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $partitions; + /** + * Optional. Default partition to use for submitted jobs that do not + * explicitly specify a partition. Required if and only if there is more than + * one partition, in which case it must match the id of one of the partitions. + * + * Generated from protobuf field string default_partition = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $default_partition = ''; + /** + * Optional. Slurm [prolog + * scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be + * executed by compute nodes before a node begins running a new job. Values + * must not be empty. + * + * Generated from protobuf field repeated string prolog_bash_scripts = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $prolog_bash_scripts; + /** + * Optional. Slurm [epilog + * scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be + * executed by compute nodes whenever a node finishes running a job. Values + * must not be empty. + * + * Generated from protobuf field repeated string epilog_bash_scripts = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $epilog_bash_scripts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\SlurmLoginNodes $login_nodes + * Required. Configuration for login nodes, which allow users to access the + * cluster over SSH. + * @type \Google\Cloud\HypercomputeCluster\V1\SlurmNodeSet[] $node_sets + * Optional. Compute resource configuration for the Slurm nodesets in your + * cluster. If not specified, the cluster won't create any nodes. + * @type \Google\Cloud\HypercomputeCluster\V1\SlurmPartition[] $partitions + * Optional. Configuration for the Slurm partitions in your cluster. Each + * partition can contain one or more nodesets, and you can submit separate + * jobs on each partition. If you don't specify at least one partition in your + * cluster, you can't submit jobs to the cluster. + * @type string $default_partition + * Optional. Default partition to use for submitted jobs that do not + * explicitly specify a partition. Required if and only if there is more than + * one partition, in which case it must match the id of one of the partitions. + * @type string[] $prolog_bash_scripts + * Optional. Slurm [prolog + * scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be + * executed by compute nodes before a node begins running a new job. Values + * must not be empty. + * @type string[] $epilog_bash_scripts + * Optional. Slurm [epilog + * scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be + * executed by compute nodes whenever a node finishes running a job. Values + * must not be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Configuration for login nodes, which allow users to access the + * cluster over SSH. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.SlurmLoginNodes login_nodes = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\HypercomputeCluster\V1\SlurmLoginNodes|null + */ + public function getLoginNodes() + { + return $this->login_nodes; + } + + public function hasLoginNodes() + { + return isset($this->login_nodes); + } + + public function clearLoginNodes() + { + unset($this->login_nodes); + } + + /** + * Required. Configuration for login nodes, which allow users to access the + * cluster over SSH. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.SlurmLoginNodes login_nodes = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\HypercomputeCluster\V1\SlurmLoginNodes $var + * @return $this + */ + public function setLoginNodes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\SlurmLoginNodes::class); + $this->login_nodes = $var; + + return $this; + } + + /** + * Optional. Compute resource configuration for the Slurm nodesets in your + * cluster. If not specified, the cluster won't create any nodes. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.SlurmNodeSet node_sets = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\HypercomputeCluster\V1\SlurmNodeSet> + */ + public function getNodeSets() + { + return $this->node_sets; + } + + /** + * Optional. Compute resource configuration for the Slurm nodesets in your + * cluster. If not specified, the cluster won't create any nodes. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.SlurmNodeSet node_sets = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\SlurmNodeSet[] $var + * @return $this + */ + public function setNodeSets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\SlurmNodeSet::class); + $this->node_sets = $arr; + + return $this; + } + + /** + * Optional. Configuration for the Slurm partitions in your cluster. Each + * partition can contain one or more nodesets, and you can submit separate + * jobs on each partition. If you don't specify at least one partition in your + * cluster, you can't submit jobs to the cluster. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.SlurmPartition partitions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\HypercomputeCluster\V1\SlurmPartition> + */ + public function getPartitions() + { + return $this->partitions; + } + + /** + * Optional. Configuration for the Slurm partitions in your cluster. Each + * partition can contain one or more nodesets, and you can submit separate + * jobs on each partition. If you don't specify at least one partition in your + * cluster, you can't submit jobs to the cluster. + * + * Generated from protobuf field repeated .google.cloud.hypercomputecluster.v1.SlurmPartition partitions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\HypercomputeCluster\V1\SlurmPartition[] $var + * @return $this + */ + public function setPartitions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\HypercomputeCluster\V1\SlurmPartition::class); + $this->partitions = $arr; + + return $this; + } + + /** + * Optional. Default partition to use for submitted jobs that do not + * explicitly specify a partition. Required if and only if there is more than + * one partition, in which case it must match the id of one of the partitions. + * + * Generated from protobuf field string default_partition = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDefaultPartition() + { + return $this->default_partition; + } + + /** + * Optional. Default partition to use for submitted jobs that do not + * explicitly specify a partition. Required if and only if there is more than + * one partition, in which case it must match the id of one of the partitions. + * + * Generated from protobuf field string default_partition = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDefaultPartition($var) + { + GPBUtil::checkString($var, True); + $this->default_partition = $var; + + return $this; + } + + /** + * Optional. Slurm [prolog + * scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be + * executed by compute nodes before a node begins running a new job. Values + * must not be empty. + * + * Generated from protobuf field repeated string prolog_bash_scripts = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getPrologBashScripts() + { + return $this->prolog_bash_scripts; + } + + /** + * Optional. Slurm [prolog + * scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be + * executed by compute nodes before a node begins running a new job. Values + * must not be empty. + * + * Generated from protobuf field repeated string prolog_bash_scripts = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setPrologBashScripts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->prolog_bash_scripts = $arr; + + return $this; + } + + /** + * Optional. Slurm [epilog + * scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be + * executed by compute nodes whenever a node finishes running a job. Values + * must not be empty. + * + * Generated from protobuf field repeated string epilog_bash_scripts = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getEpilogBashScripts() + { + return $this->epilog_bash_scripts; + } + + /** + * Optional. Slurm [epilog + * scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be + * executed by compute nodes whenever a node finishes running a job. Values + * must not be empty. + * + * Generated from protobuf field repeated string epilog_bash_scripts = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setEpilogBashScripts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->epilog_bash_scripts = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/SlurmPartition.php b/HypercomputeCluster/src/V1/SlurmPartition.php new file mode 100644 index 000000000000..56356e8bafab --- /dev/null +++ b/HypercomputeCluster/src/V1/SlurmPartition.php @@ -0,0 +1,118 @@ +google.cloud.hypercomputecluster.v1.SlurmPartition + */ +class SlurmPartition extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the partition, which is how users will identify it. Must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $id = ''; + /** + * Required. IDs of the nodesets that make up this partition. Values must + * match + * [SlurmNodeSet.id][google.cloud.hypercomputecluster.v1.SlurmNodeSet.id]. + * + * Generated from protobuf field repeated string node_set_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $node_set_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. ID of the partition, which is how users will identify it. Must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * @type string[] $node_set_ids + * Required. IDs of the nodesets that make up this partition. Values must + * match + * [SlurmNodeSet.id][google.cloud.hypercomputecluster.v1.SlurmNodeSet.id]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the partition, which is how users will identify it. Must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. ID of the partition, which is how users will identify it. Must + * conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (lower-case, alphanumeric, and at most 63 characters). + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Required. IDs of the nodesets that make up this partition. Values must + * match + * [SlurmNodeSet.id][google.cloud.hypercomputecluster.v1.SlurmNodeSet.id]. + * + * Generated from protobuf field repeated string node_set_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getNodeSetIds() + { + return $this->node_set_ids; + } + + /** + * Required. IDs of the nodesets that make up this partition. Values must + * match + * [SlurmNodeSet.id][google.cloud.hypercomputecluster.v1.SlurmNodeSet.id]. + * + * Generated from protobuf field repeated string node_set_ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string[] $var + * @return $this + */ + public function setNodeSetIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->node_set_ids = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/StorageConfig.php b/HypercomputeCluster/src/V1/StorageConfig.php new file mode 100644 index 000000000000..331ff0f573d4 --- /dev/null +++ b/HypercomputeCluster/src/V1/StorageConfig.php @@ -0,0 +1,115 @@ +google.cloud.hypercomputecluster.v1.StorageConfig + */ +class StorageConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the storage resource to mount, which must match a key in + * the cluster's + * [storage_resources][google.cloud.hypercomputecluster.v1.Cluster.storage_resources]. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $id = ''; + /** + * Required. A directory inside the VM instance's file system where the + * storage resource should be mounted (e.g., `/mnt/share`). + * + * Generated from protobuf field string local_mount = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $local_mount = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. ID of the storage resource to mount, which must match a key in + * the cluster's + * [storage_resources][google.cloud.hypercomputecluster.v1.Cluster.storage_resources]. + * @type string $local_mount + * Required. A directory inside the VM instance's file system where the + * storage resource should be mounted (e.g., `/mnt/share`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the storage resource to mount, which must match a key in + * the cluster's + * [storage_resources][google.cloud.hypercomputecluster.v1.Cluster.storage_resources]. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. ID of the storage resource to mount, which must match a key in + * the cluster's + * [storage_resources][google.cloud.hypercomputecluster.v1.Cluster.storage_resources]. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Required. A directory inside the VM instance's file system where the + * storage resource should be mounted (e.g., `/mnt/share`). + * + * Generated from protobuf field string local_mount = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLocalMount() + { + return $this->local_mount; + } + + /** + * Required. A directory inside the VM instance's file system where the + * storage resource should be mounted (e.g., `/mnt/share`). + * + * Generated from protobuf field string local_mount = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLocalMount($var) + { + GPBUtil::checkString($var, True); + $this->local_mount = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/StorageResource.php b/HypercomputeCluster/src/V1/StorageResource.php new file mode 100644 index 000000000000..c258b3553993 --- /dev/null +++ b/HypercomputeCluster/src/V1/StorageResource.php @@ -0,0 +1,211 @@ +google.cloud.hypercomputecluster.v1.StorageResource + */ +class StorageResource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. Configuration for this storage resource, which + * describes how it should be created or imported. This field only controls + * how the storage resource is initially created or imported. Subsequent + * changes to the storage resource should be made via the resource's API and + * will not be reflected in the configuration. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.StorageResourceConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $config = null; + protected $reference; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\FilestoreReference $filestore + * Reference to a Filestore instance. Populated if and only if the storage + * resource was configured to use Filestore. + * @type \Google\Cloud\HypercomputeCluster\V1\BucketReference $bucket + * Reference to a Google Cloud Storage bucket. Populated if and only if the + * storage resource was configured to use Google Cloud Storage. + * @type \Google\Cloud\HypercomputeCluster\V1\LustreReference $lustre + * Reference to a Managed Lustre instance. Populated if and only if the + * storage resource was configured to use Managed Lustre. + * @type \Google\Cloud\HypercomputeCluster\V1\StorageResourceConfig $config + * Required. Immutable. Configuration for this storage resource, which + * describes how it should be created or imported. This field only controls + * how the storage resource is initially created or imported. Subsequent + * changes to the storage resource should be made via the resource's API and + * will not be reflected in the configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Reference to a Filestore instance. Populated if and only if the storage + * resource was configured to use Filestore. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.FilestoreReference filestore = 1; + * @return \Google\Cloud\HypercomputeCluster\V1\FilestoreReference|null + */ + public function getFilestore() + { + return $this->readOneof(1); + } + + public function hasFilestore() + { + return $this->hasOneof(1); + } + + /** + * Reference to a Filestore instance. Populated if and only if the storage + * resource was configured to use Filestore. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.FilestoreReference filestore = 1; + * @param \Google\Cloud\HypercomputeCluster\V1\FilestoreReference $var + * @return $this + */ + public function setFilestore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\FilestoreReference::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Reference to a Google Cloud Storage bucket. Populated if and only if the + * storage resource was configured to use Google Cloud Storage. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.BucketReference bucket = 2; + * @return \Google\Cloud\HypercomputeCluster\V1\BucketReference|null + */ + public function getBucket() + { + return $this->readOneof(2); + } + + public function hasBucket() + { + return $this->hasOneof(2); + } + + /** + * Reference to a Google Cloud Storage bucket. Populated if and only if the + * storage resource was configured to use Google Cloud Storage. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.BucketReference bucket = 2; + * @param \Google\Cloud\HypercomputeCluster\V1\BucketReference $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\BucketReference::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Reference to a Managed Lustre instance. Populated if and only if the + * storage resource was configured to use Managed Lustre. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.LustreReference lustre = 3; + * @return \Google\Cloud\HypercomputeCluster\V1\LustreReference|null + */ + public function getLustre() + { + return $this->readOneof(3); + } + + public function hasLustre() + { + return $this->hasOneof(3); + } + + /** + * Reference to a Managed Lustre instance. Populated if and only if the + * storage resource was configured to use Managed Lustre. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.LustreReference lustre = 3; + * @param \Google\Cloud\HypercomputeCluster\V1\LustreReference $var + * @return $this + */ + public function setLustre($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\LustreReference::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Immutable. Configuration for this storage resource, which + * describes how it should be created or imported. This field only controls + * how the storage resource is initially created or imported. Subsequent + * changes to the storage resource should be made via the resource's API and + * will not be reflected in the configuration. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.StorageResourceConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\StorageResourceConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Required. Immutable. Configuration for this storage resource, which + * describes how it should be created or imported. This field only controls + * how the storage resource is initially created or imported. Subsequent + * changes to the storage resource should be made via the resource's API and + * will not be reflected in the configuration. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.StorageResourceConfig config = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\StorageResourceConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\StorageResourceConfig::class); + $this->config = $var; + + return $this; + } + + /** + * @return string + */ + public function getReference() + { + return $this->whichOneof("reference"); + } + +} + diff --git a/HypercomputeCluster/src/V1/StorageResourceConfig.php b/HypercomputeCluster/src/V1/StorageResourceConfig.php new file mode 100644 index 000000000000..54747f814a5f --- /dev/null +++ b/HypercomputeCluster/src/V1/StorageResourceConfig.php @@ -0,0 +1,260 @@ +google.cloud.hypercomputecluster.v1.StorageResourceConfig + */ +class StorageResourceConfig extends \Google\Protobuf\Internal\Message +{ + protected $config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\NewFilestoreConfig $new_filestore + * Optional. Immutable. If set, indicates that a new Filestore instance + * should be created. + * @type \Google\Cloud\HypercomputeCluster\V1\ExistingFilestoreConfig $existing_filestore + * Optional. Immutable. If set, indicates that an existing Filestore + * instance should be imported. + * @type \Google\Cloud\HypercomputeCluster\V1\NewBucketConfig $new_bucket + * Optional. Immutable. If set, indicates that a new Cloud Storage bucket + * should be created. + * @type \Google\Cloud\HypercomputeCluster\V1\ExistingBucketConfig $existing_bucket + * Optional. Immutable. If set, indicates that an existing Cloud Storage + * bucket should be imported. + * @type \Google\Cloud\HypercomputeCluster\V1\NewLustreConfig $new_lustre + * Optional. Immutable. If set, indicates that a new Managed Lustre instance + * should be created. + * @type \Google\Cloud\HypercomputeCluster\V1\ExistingLustreConfig $existing_lustre + * Optional. Immutable. If set, indicates that an existing Managed Lustre + * instance should be imported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Immutable. If set, indicates that a new Filestore instance + * should be created. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFilestoreConfig new_filestore = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NewFilestoreConfig|null + */ + public function getNewFilestore() + { + return $this->readOneof(1); + } + + public function hasNewFilestore() + { + return $this->hasOneof(1); + } + + /** + * Optional. Immutable. If set, indicates that a new Filestore instance + * should be created. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewFilestoreConfig new_filestore = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NewFilestoreConfig $var + * @return $this + */ + public function setNewFilestore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NewFilestoreConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that an existing Filestore + * instance should be imported. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ExistingFilestoreConfig existing_filestore = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\ExistingFilestoreConfig|null + */ + public function getExistingFilestore() + { + return $this->readOneof(2); + } + + public function hasExistingFilestore() + { + return $this->hasOneof(2); + } + + /** + * Optional. Immutable. If set, indicates that an existing Filestore + * instance should be imported. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ExistingFilestoreConfig existing_filestore = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\ExistingFilestoreConfig $var + * @return $this + */ + public function setExistingFilestore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\ExistingFilestoreConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that a new Cloud Storage bucket + * should be created. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewBucketConfig new_bucket = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NewBucketConfig|null + */ + public function getNewBucket() + { + return $this->readOneof(3); + } + + public function hasNewBucket() + { + return $this->hasOneof(3); + } + + /** + * Optional. Immutable. If set, indicates that a new Cloud Storage bucket + * should be created. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewBucketConfig new_bucket = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NewBucketConfig $var + * @return $this + */ + public function setNewBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NewBucketConfig::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that an existing Cloud Storage + * bucket should be imported. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ExistingBucketConfig existing_bucket = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\ExistingBucketConfig|null + */ + public function getExistingBucket() + { + return $this->readOneof(4); + } + + public function hasExistingBucket() + { + return $this->hasOneof(4); + } + + /** + * Optional. Immutable. If set, indicates that an existing Cloud Storage + * bucket should be imported. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ExistingBucketConfig existing_bucket = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\ExistingBucketConfig $var + * @return $this + */ + public function setExistingBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\ExistingBucketConfig::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that a new Managed Lustre instance + * should be created. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewLustreConfig new_lustre = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\NewLustreConfig|null + */ + public function getNewLustre() + { + return $this->readOneof(5); + } + + public function hasNewLustre() + { + return $this->hasOneof(5); + } + + /** + * Optional. Immutable. If set, indicates that a new Managed Lustre instance + * should be created. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.NewLustreConfig new_lustre = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\NewLustreConfig $var + * @return $this + */ + public function setNewLustre($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\NewLustreConfig::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. Immutable. If set, indicates that an existing Managed Lustre + * instance should be imported. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ExistingLustreConfig existing_lustre = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\HypercomputeCluster\V1\ExistingLustreConfig|null + */ + public function getExistingLustre() + { + return $this->readOneof(6); + } + + public function hasExistingLustre() + { + return $this->hasOneof(6); + } + + /** + * Optional. Immutable. If set, indicates that an existing Managed Lustre + * instance should be imported. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.ExistingLustreConfig existing_lustre = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\HypercomputeCluster\V1\ExistingLustreConfig $var + * @return $this + */ + public function setExistingLustre($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\ExistingLustreConfig::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getConfig() + { + return $this->whichOneof("config"); + } + +} + diff --git a/HypercomputeCluster/src/V1/UpdateClusterRequest.php b/HypercomputeCluster/src/V1/UpdateClusterRequest.php new file mode 100644 index 000000000000..982b7321f0f1 --- /dev/null +++ b/HypercomputeCluster/src/V1/UpdateClusterRequest.php @@ -0,0 +1,189 @@ +google.cloud.hypercomputecluster.v1.UpdateClusterRequest + */ +class UpdateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Cluster to update. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Optional. Mask specifying which fields in the cluster to update. All paths + * must be specified explicitly - wildcards are not supported. At least one + * path must be provided. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\HypercomputeCluster\V1\Cluster $cluster Required. Cluster to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Mask specifying which fields in the cluster to update. All paths + * must be specified explicitly - wildcards are not supported. At least one + * path must be provided. + * + * @return \Google\Cloud\HypercomputeCluster\V1\UpdateClusterRequest + * + * @experimental + */ + public static function build(\Google\Cloud\HypercomputeCluster\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\HypercomputeCluster\V1\Cluster $cluster + * Required. Cluster to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Mask specifying which fields in the cluster to update. All paths + * must be specified explicitly - wildcards are not supported. At least one + * path must be provided. + * @type string $request_id + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\HypercomputeCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Cluster to update. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\HypercomputeCluster\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. Cluster to update. + * + * Generated from protobuf field .google.cloud.hypercomputecluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\HypercomputeCluster\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Optional. Mask specifying which fields in the cluster to update. All paths + * must be specified explicitly - wildcards are not supported. At least one + * path must be provided. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Mask specifying which fields in the cluster to update. All paths + * must be specified explicitly - wildcards are not supported. At least one + * path must be provided. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A unique identifier for this request. A random UUID is + * recommended. This request is idempotent if and only if `request_id` is + * provided. + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/UpdateLoginNode.php b/HypercomputeCluster/src/V1/UpdateLoginNode.php new file mode 100644 index 000000000000..dfe51d0d42c0 --- /dev/null +++ b/HypercomputeCluster/src/V1/UpdateLoginNode.php @@ -0,0 +1,33 @@ +google.cloud.hypercomputecluster.v1.UpdateLoginNode + */ +class UpdateLoginNode extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/UpdateNodeset.php b/HypercomputeCluster/src/V1/UpdateNodeset.php new file mode 100644 index 000000000000..04b2789674ac --- /dev/null +++ b/HypercomputeCluster/src/V1/UpdateNodeset.php @@ -0,0 +1,67 @@ +google.cloud.hypercomputecluster.v1.UpdateNodeset + */ +class UpdateNodeset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the nodeset to update + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $nodesets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $nodesets + * Output only. Name of the nodeset to update + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the nodeset to update + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField + */ + public function getNodesets() + { + return $this->nodesets; + } + + /** + * Output only. Name of the nodeset to update + * + * Generated from protobuf field repeated string nodesets = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string[] $var + * @return $this + */ + public function setNodesets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nodesets = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/UpdateOrchestrator.php b/HypercomputeCluster/src/V1/UpdateOrchestrator.php new file mode 100644 index 000000000000..a25f781bb8c0 --- /dev/null +++ b/HypercomputeCluster/src/V1/UpdateOrchestrator.php @@ -0,0 +1,33 @@ +google.cloud.hypercomputecluster.v1.UpdateOrchestrator + */ +class UpdateOrchestrator extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + +} + diff --git a/HypercomputeCluster/src/V1/UpdatePartition.php b/HypercomputeCluster/src/V1/UpdatePartition.php new file mode 100644 index 000000000000..cbcc7be2af44 --- /dev/null +++ b/HypercomputeCluster/src/V1/UpdatePartition.php @@ -0,0 +1,67 @@ +google.cloud.hypercomputecluster.v1.UpdatePartition + */ +class UpdatePartition extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the partition to update + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $partitions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $partitions + * Output only. Name of the partition to update + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Hypercomputecluster\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the partition to update + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField + */ + public function getPartitions() + { + return $this->partitions; + } + + /** + * Output only. Name of the partition to update + * + * Generated from protobuf field repeated string partitions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string[] $var + * @return $this + */ + public function setPartitions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->partitions = $arr; + + return $this; + } + +} + diff --git a/HypercomputeCluster/src/V1/gapic_metadata.json b/HypercomputeCluster/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..c6acc0c31886 --- /dev/null +++ b/HypercomputeCluster/src/V1/gapic_metadata.json @@ -0,0 +1,53 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.hypercomputecluster.v1", + "libraryPackage": "Google\\Cloud\\HypercomputeCluster\\V1", + "services": { + "HypercomputeCluster": { + "clients": { + "grpc": { + "libraryClient": "HypercomputeClusterGapicClient", + "rpcs": { + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/HypercomputeCluster/src/V1/resources/hypercompute_cluster_client_config.json b/HypercomputeCluster/src/V1/resources/hypercompute_cluster_client_config.json new file mode 100644 index 000000000000..8dc1c780b9a0 --- /dev/null +++ b/HypercomputeCluster/src/V1/resources/hypercompute_cluster_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.hypercomputecluster.v1.HypercomputeCluster": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 3600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 3600000, + "total_timeout_millis": 3600000 + } + }, + "methods": { + "CreateCluster": { + "timeout_millis": 3600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteCluster": { + "timeout_millis": 3600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateCluster": { + "timeout_millis": 3600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/HypercomputeCluster/src/V1/resources/hypercompute_cluster_descriptor_config.php b/HypercomputeCluster/src/V1/resources/hypercompute_cluster_descriptor_config.php new file mode 100644 index 000000000000..e3f7a9f73a98 --- /dev/null +++ b/HypercomputeCluster/src/V1/resources/hypercompute_cluster_descriptor_config.php @@ -0,0 +1,164 @@ + [ + 'google.cloud.hypercomputecluster.v1.HypercomputeCluster' => [ + 'CreateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\HypercomputeCluster\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\HypercomputeCluster\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\HypercomputeCluster\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\HypercomputeCluster\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\HypercomputeCluster\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'cluster.name', + 'fieldAccessors' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\HypercomputeCluster\V1\Cluster', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListClusters' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClusters', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\HypercomputeCluster\V1\ListClustersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'bucket' => 'projects/{project}/buckets/{bucket}', + 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', + 'computeInstance' => 'projects/{project}/zones/{zone}/instances/{instance}', + 'diskType' => 'projects/{project}/zones/{zone}/diskTypes/{disk_type}', + 'fileInstance' => 'projects/{project}/locations/{location}/instances/{instance}', + 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', + 'location' => 'projects/{project}/locations/{location}', + 'network' => 'projects/{project}/global/networks/{network}', + 'reservation' => 'projects/{project}/zones/{zone}/reservations/{reservation}', + 'subnetwork' => 'projects/{project}/regions/{region}/subnetworks/{subnetwork}', + ], + ], + ], +]; diff --git a/HypercomputeCluster/src/V1/resources/hypercompute_cluster_rest_client_config.php b/HypercomputeCluster/src/V1/resources/hypercompute_cluster_rest_client_config.php new file mode 100644 index 000000000000..d334f23fd90c --- /dev/null +++ b/HypercomputeCluster/src/V1/resources/hypercompute_cluster_rest_client_config.php @@ -0,0 +1,161 @@ + [ + 'google.cloud.hypercomputecluster.v1.HypercomputeCluster' => [ + 'CreateCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'cluster_id', + ], + ], + 'DeleteCluster' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListClusters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{cluster.name=projects/*/locations/*/clusters/*}', + 'body' => 'cluster', + 'placeholders' => [ + 'cluster.name' => [ + 'getters' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/HypercomputeCluster/tests/Unit/V1/Client/HypercomputeClusterClientTest.php b/HypercomputeCluster/tests/Unit/V1/Client/HypercomputeClusterClientTest.php new file mode 100644 index 000000000000..ddc374262a7d --- /dev/null +++ b/HypercomputeCluster/tests/Unit/V1/Client/HypercomputeClusterClientTest.php @@ -0,0 +1,816 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return HypercomputeClusterClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new HypercomputeClusterClient($options); + } + + /** @test */ + public function createClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.hypercomputecluster.v1.HypercomputeCluster/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest())->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.hypercomputecluster.v1.HypercomputeCluster/DeleteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest())->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setReconciling($reconciling); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest())->setName($formattedName); + $response = $gapicClient->getCluster($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.hypercomputecluster.v1.HypercomputeCluster/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest())->setName($formattedName); + try { + $gapicClient->getCluster($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clustersElement = new Cluster(); + $clusters = [$clustersElement]; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClusters($clusters); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest())->setParent($formattedParent); + $response = $gapicClient->listClusters($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.hypercomputecluster.v1.HypercomputeCluster/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest())->setParent($formattedParent); + try { + $gapicClient->listClusters($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $cluster = new Cluster(); + $request = (new UpdateClusterRequest())->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.hypercomputecluster.v1.HypercomputeCluster/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $cluster = new Cluster(); + $request = (new UpdateClusterRequest())->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [$locationsElement]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createClusterAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $reconciling = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setReconciling($reconciling); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createClusterAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.hypercomputecluster.v1.HypercomputeCluster/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +}