Reference documentation and code samples for the Google Cloud Container V1 Client class SetLabelsRequest.
SetLabelsRequest sets the Google Cloud Platform labels on a Google Container
Engine cluster, which will in turn set them for Google Compute Engine
resources used by that cluster
Generated from protobuf messagegoogle.container.v1.SetLabelsRequest
Namespace
Google \ Cloud \ Container \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ project_id
string
Deprecated. The Google Developers Consoleproject ID or project number. This field has been deprecated and replaced by the name field.
↳ zone
string
Deprecated. The name of the Google Compute Enginezonein which the cluster resides. This field has been deprecated and replaced by the name field.
↳ cluster_id
string
Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.
Required. The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Kubernetes Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels. Make aget()request to the resource to get the latest fingerprint.
↳ name
string
The name (project, location, cluster name) of the cluster to set labels. Specified in the formatprojects/*/locations/*/clusters/*.
Required. The fingerprint of the previous set of labels for this resource,
used to detect conflicts. The fingerprint is initially generated by
Kubernetes Engine and changes after every request to modify or update
labels. You must always provide an up-to-date fingerprint hash when
updating or changing labels. Make aget()request to the
resource to get the latest fingerprint.
Returns
Type
Description
string
setLabelFingerprint
Required. The fingerprint of the previous set of labels for this resource,
used to detect conflicts. The fingerprint is initially generated by
Kubernetes Engine and changes after every request to modify or update
labels. You must always provide an up-to-date fingerprint hash when
updating or changing labels. Make aget()request to the
resource to get the latest fingerprint.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getName
The name (project, location, cluster name) of the cluster to set labels.
Specified in the formatprojects/*/locations/*/clusters/*.
Returns
Type
Description
string
setName
The name (project, location, cluster name) of the cluster to set labels.
Specified in the formatprojects/*/locations/*/clusters/*.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Container V1 Client - Class SetLabelsRequest (2.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.5.0 (latest)](/php/docs/reference/cloud-container/latest/V1.SetLabelsRequest)\n- [2.4.0](/php/docs/reference/cloud-container/2.4.0/V1.SetLabelsRequest)\n- [2.3.4](/php/docs/reference/cloud-container/2.3.4/V1.SetLabelsRequest)\n- [2.2.1](/php/docs/reference/cloud-container/2.2.1/V1.SetLabelsRequest)\n- [2.1.0](/php/docs/reference/cloud-container/2.1.0/V1.SetLabelsRequest)\n- [2.0.0](/php/docs/reference/cloud-container/2.0.0/V1.SetLabelsRequest)\n- [1.33.0](/php/docs/reference/cloud-container/1.33.0/V1.SetLabelsRequest)\n- [1.32.0](/php/docs/reference/cloud-container/1.32.0/V1.SetLabelsRequest)\n- [1.31.0](/php/docs/reference/cloud-container/1.31.0/V1.SetLabelsRequest)\n- [1.30.3](/php/docs/reference/cloud-container/1.30.3/V1.SetLabelsRequest)\n- [1.24.0](/php/docs/reference/cloud-container/1.24.0/V1.SetLabelsRequest)\n- [1.23.0](/php/docs/reference/cloud-container/1.23.0/V1.SetLabelsRequest)\n- [1.22.0](/php/docs/reference/cloud-container/1.22.0/V1.SetLabelsRequest)\n- [1.21.1](/php/docs/reference/cloud-container/1.21.1/V1.SetLabelsRequest)\n- [1.20.0](/php/docs/reference/cloud-container/1.20.0/V1.SetLabelsRequest)\n- [1.19.0](/php/docs/reference/cloud-container/1.19.0/V1.SetLabelsRequest)\n- [1.18.0](/php/docs/reference/cloud-container/1.18.0/V1.SetLabelsRequest)\n- [1.17.1](/php/docs/reference/cloud-container/1.17.1/V1.SetLabelsRequest)\n- [1.16.0](/php/docs/reference/cloud-container/1.16.0/V1.SetLabelsRequest)\n- [1.15.0](/php/docs/reference/cloud-container/1.15.0/V1.SetLabelsRequest)\n- [1.14.0](/php/docs/reference/cloud-container/1.14.0/V1.SetLabelsRequest)\n- [1.13.1](/php/docs/reference/cloud-container/1.13.1/V1.SetLabelsRequest)\n- [1.12.1](/php/docs/reference/cloud-container/1.12.1/V1.SetLabelsRequest)\n- [1.10.3](/php/docs/reference/cloud-container/1.10.3/V1.SetLabelsRequest)\n- [1.9.1](/php/docs/reference/cloud-container/1.9.1/V1.SetLabelsRequest) \nReference documentation and code samples for the Google Cloud Container V1 Client class SetLabelsRequest.\n\nSetLabelsRequest sets the Google Cloud Platform labels on a Google Container\nEngine cluster, which will in turn set them for Google Compute Engine\nresources used by that cluster\n\nGenerated from protobuf message `google.container.v1.SetLabelsRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Container \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getProjectId\n\nDeprecated. The Google Developers Console [project ID or project\nnumber](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\nThis field has been deprecated and replaced by the name field.\n\n### setProjectId\n\nDeprecated. The Google Developers Console [project ID or project\nnumber](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\nThis field has been deprecated and replaced by the name field.\n\n### getZone\n\nDeprecated. The name of the Google Compute Engine\n[zone](https://cloud.google.com/compute/docs/zones#available)\nin which the cluster resides. This field has been deprecated and replaced\nby the name field.\n\n### setZone\n\nDeprecated. The name of the Google Compute Engine\n[zone](https://cloud.google.com/compute/docs/zones#available)\nin which the cluster resides. This field has been deprecated and replaced\nby the name field.\n\n### getClusterId\n\nDeprecated. The name of the cluster.\n\nThis field has been deprecated and replaced by the name field.\n\n### setClusterId\n\nDeprecated. The name of the cluster.\n\nThis field has been deprecated and replaced by the name field.\n\n### getResourceLabels\n\nRequired. The labels to set for that cluster.\n\n### setResourceLabels\n\nRequired. The labels to set for that cluster.\n\n### getLabelFingerprint\n\nRequired. The fingerprint of the previous set of labels for this resource,\nused to detect conflicts. The fingerprint is initially generated by\nKubernetes Engine and changes after every request to modify or update\nlabels. You must always provide an up-to-date fingerprint hash when\nupdating or changing labels. Make a `get()` request to the\nresource to get the latest fingerprint.\n\n### setLabelFingerprint\n\nRequired. The fingerprint of the previous set of labels for this resource,\nused to detect conflicts. The fingerprint is initially generated by\nKubernetes Engine and changes after every request to modify or update\nlabels. You must always provide an up-to-date fingerprint hash when\nupdating or changing labels. Make a `get()` request to the\nresource to get the latest fingerprint.\n\n### getName\n\nThe name (project, location, cluster name) of the cluster to set labels.\n\nSpecified in the format `projects/*/locations/*/clusters/*`.\n\n### setName\n\nThe name (project, location, cluster name) of the cluster to set labels.\n\nSpecified in the format `projects/*/locations/*/clusters/*`."]]