diff --git a/GkeHub/metadata/V1/Configmanagement/Configmanagement.php b/GkeHub/metadata/V1/Configmanagement/Configmanagement.php index c06402a96f6c..871dfa00a5ed 100644 Binary files a/GkeHub/metadata/V1/Configmanagement/Configmanagement.php and b/GkeHub/metadata/V1/Configmanagement/Configmanagement.php differ diff --git a/GkeHub/src/ConfigManagement/V1/ConfigSync.php b/GkeHub/src/ConfigManagement/V1/ConfigSync.php index cf80fa18fac3..3500f9e18b57 100644 --- a/GkeHub/src/ConfigManagement/V1/ConfigSync.php +++ b/GkeHub/src/ConfigManagement/V1/ConfigSync.php @@ -23,11 +23,48 @@ class ConfigSync extends \Google\Protobuf\Internal\Message private $git = null; /** * Specifies whether the Config Sync Repo is - * in “hierarchical” or “unstructured” mode. + * in "hierarchical" or "unstructured" mode. * * Generated from protobuf field string source_format = 8; */ private $source_format = ''; + /** + * Enables the installation of ConfigSync. + * If set to true, ConfigSync resources will be created and the other + * ConfigSync fields will be applied if exist. + * If set to false, all other ConfigSync fields will be ignored, ConfigSync + * resources will be deleted. + * If omitted, ConfigSync resources will be managed depends on the presence + * of the git or oci field. + * + * Generated from protobuf field optional bool enabled = 10; + */ + private $enabled = null; + /** + * Set to true to enable the Config Sync admission webhook to prevent drifts. + * If set to `false`, disables the Config Sync admission webhook and does not + * prevent drifts. + * + * Generated from protobuf field bool prevent_drift = 11; + */ + private $prevent_drift = false; + /** + * OCI repo configuration for the cluster + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.OciConfig oci = 12; + */ + private $oci = null; + /** + * The Email of the Google Cloud Service Account (GSA) used for exporting + * Config Sync metrics to Cloud Monitoring when Workload Identity is enabled. + * The GSA should have the Monitoring Metric Writer + * (roles/monitoring.metricWriter) IAM role. + * The Kubernetes ServiceAccount `default` in the namespace + * `config-management-monitoring` should be bound to the GSA. + * + * Generated from protobuf field string metrics_gcp_service_account_email = 15; + */ + private $metrics_gcp_service_account_email = ''; /** * Constructor. @@ -39,7 +76,28 @@ class ConfigSync extends \Google\Protobuf\Internal\Message * Git repo configuration for the cluster. * @type string $source_format * Specifies whether the Config Sync Repo is - * in “hierarchical” or “unstructured” mode. + * in "hierarchical" or "unstructured" mode. + * @type bool $enabled + * Enables the installation of ConfigSync. + * If set to true, ConfigSync resources will be created and the other + * ConfigSync fields will be applied if exist. + * If set to false, all other ConfigSync fields will be ignored, ConfigSync + * resources will be deleted. + * If omitted, ConfigSync resources will be managed depends on the presence + * of the git or oci field. + * @type bool $prevent_drift + * Set to true to enable the Config Sync admission webhook to prevent drifts. + * If set to `false`, disables the Config Sync admission webhook and does not + * prevent drifts. + * @type \Google\Cloud\GkeHub\ConfigManagement\V1\OciConfig $oci + * OCI repo configuration for the cluster + * @type string $metrics_gcp_service_account_email + * The Email of the Google Cloud Service Account (GSA) used for exporting + * Config Sync metrics to Cloud Monitoring when Workload Identity is enabled. + * The GSA should have the Monitoring Metric Writer + * (roles/monitoring.metricWriter) IAM role. + * The Kubernetes ServiceAccount `default` in the namespace + * `config-management-monitoring` should be bound to the GSA. * } */ public function __construct($data = NULL) { @@ -85,7 +143,7 @@ public function setGit($var) /** * Specifies whether the Config Sync Repo is - * in “hierarchical” or “unstructured” mode. + * in "hierarchical" or "unstructured" mode. * * Generated from protobuf field string source_format = 8; * @return string @@ -97,7 +155,7 @@ public function getSourceFormat() /** * Specifies whether the Config Sync Repo is - * in “hierarchical” or “unstructured” mode. + * in "hierarchical" or "unstructured" mode. * * Generated from protobuf field string source_format = 8; * @param string $var @@ -111,5 +169,155 @@ public function setSourceFormat($var) return $this; } + /** + * Enables the installation of ConfigSync. + * If set to true, ConfigSync resources will be created and the other + * ConfigSync fields will be applied if exist. + * If set to false, all other ConfigSync fields will be ignored, ConfigSync + * resources will be deleted. + * If omitted, ConfigSync resources will be managed depends on the presence + * of the git or oci field. + * + * Generated from protobuf field optional bool enabled = 10; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Enables the installation of ConfigSync. + * If set to true, ConfigSync resources will be created and the other + * ConfigSync fields will be applied if exist. + * If set to false, all other ConfigSync fields will be ignored, ConfigSync + * resources will be deleted. + * If omitted, ConfigSync resources will be managed depends on the presence + * of the git or oci field. + * + * Generated from protobuf field optional bool enabled = 10; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * Set to true to enable the Config Sync admission webhook to prevent drifts. + * If set to `false`, disables the Config Sync admission webhook and does not + * prevent drifts. + * + * Generated from protobuf field bool prevent_drift = 11; + * @return bool + */ + public function getPreventDrift() + { + return $this->prevent_drift; + } + + /** + * Set to true to enable the Config Sync admission webhook to prevent drifts. + * If set to `false`, disables the Config Sync admission webhook and does not + * prevent drifts. + * + * Generated from protobuf field bool prevent_drift = 11; + * @param bool $var + * @return $this + */ + public function setPreventDrift($var) + { + GPBUtil::checkBool($var); + $this->prevent_drift = $var; + + return $this; + } + + /** + * OCI repo configuration for the cluster + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.OciConfig oci = 12; + * @return \Google\Cloud\GkeHub\ConfigManagement\V1\OciConfig|null + */ + public function getOci() + { + return $this->oci; + } + + public function hasOci() + { + return isset($this->oci); + } + + public function clearOci() + { + unset($this->oci); + } + + /** + * OCI repo configuration for the cluster + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.OciConfig oci = 12; + * @param \Google\Cloud\GkeHub\ConfigManagement\V1\OciConfig $var + * @return $this + */ + public function setOci($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\ConfigManagement\V1\OciConfig::class); + $this->oci = $var; + + return $this; + } + + /** + * The Email of the Google Cloud Service Account (GSA) used for exporting + * Config Sync metrics to Cloud Monitoring when Workload Identity is enabled. + * The GSA should have the Monitoring Metric Writer + * (roles/monitoring.metricWriter) IAM role. + * The Kubernetes ServiceAccount `default` in the namespace + * `config-management-monitoring` should be bound to the GSA. + * + * Generated from protobuf field string metrics_gcp_service_account_email = 15; + * @return string + */ + public function getMetricsGcpServiceAccountEmail() + { + return $this->metrics_gcp_service_account_email; + } + + /** + * The Email of the Google Cloud Service Account (GSA) used for exporting + * Config Sync metrics to Cloud Monitoring when Workload Identity is enabled. + * The GSA should have the Monitoring Metric Writer + * (roles/monitoring.metricWriter) IAM role. + * The Kubernetes ServiceAccount `default` in the namespace + * `config-management-monitoring` should be bound to the GSA. + * + * Generated from protobuf field string metrics_gcp_service_account_email = 15; + * @param string $var + * @return $this + */ + public function setMetricsGcpServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->metrics_gcp_service_account_email = $var; + + return $this; + } + } diff --git a/GkeHub/src/ConfigManagement/V1/ConfigSyncDeploymentState.php b/GkeHub/src/ConfigManagement/V1/ConfigSyncDeploymentState.php index bbdd64249511..517685382670 100644 --- a/GkeHub/src/ConfigManagement/V1/ConfigSyncDeploymentState.php +++ b/GkeHub/src/ConfigManagement/V1/ConfigSyncDeploymentState.php @@ -51,6 +51,12 @@ class ConfigSyncDeploymentState extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.DeploymentState root_reconciler = 6; */ private $root_reconciler = 0; + /** + * Deployment state of admission-webhook + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.DeploymentState admission_webhook = 7; + */ + private $admission_webhook = 0; /** * Constructor. @@ -70,6 +76,8 @@ class ConfigSyncDeploymentState extends \Google\Protobuf\Internal\Message * Deployment state of reconciler-manager pod * @type int $root_reconciler * Deployment state of root-reconciler + * @type int $admission_webhook + * Deployment state of admission-webhook * } */ public function __construct($data = NULL) { @@ -233,5 +241,31 @@ public function setRootReconciler($var) return $this; } + /** + * Deployment state of admission-webhook + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.DeploymentState admission_webhook = 7; + * @return int + */ + public function getAdmissionWebhook() + { + return $this->admission_webhook; + } + + /** + * Deployment state of admission-webhook + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.DeploymentState admission_webhook = 7; + * @param int $var + * @return $this + */ + public function setAdmissionWebhook($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\ConfigManagement\V1\DeploymentState::class); + $this->admission_webhook = $var; + + return $this; + } + } diff --git a/GkeHub/src/ConfigManagement/V1/ConfigSyncError.php b/GkeHub/src/ConfigManagement/V1/ConfigSyncError.php new file mode 100644 index 000000000000..d56e49417a36 --- /dev/null +++ b/GkeHub/src/ConfigManagement/V1/ConfigSyncError.php @@ -0,0 +1,67 @@ +google.cloud.gkehub.configmanagement.v1.ConfigSyncError + */ +class ConfigSyncError extends \Google\Protobuf\Internal\Message +{ + /** + * A string representing the user facing error message + * + * Generated from protobuf field string error_message = 1; + */ + private $error_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $error_message + * A string representing the user facing error message + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Configmanagement\Configmanagement::initOnce(); + parent::__construct($data); + } + + /** + * A string representing the user facing error message + * + * Generated from protobuf field string error_message = 1; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * A string representing the user facing error message + * + * Generated from protobuf field string error_message = 1; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/ConfigManagement/V1/ConfigSyncState.php b/GkeHub/src/ConfigManagement/V1/ConfigSyncState.php index 579587a04757..7576c996dc28 100644 --- a/GkeHub/src/ConfigManagement/V1/ConfigSyncState.php +++ b/GkeHub/src/ConfigManagement/V1/ConfigSyncState.php @@ -34,6 +34,31 @@ class ConfigSyncState extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.SyncState sync_state = 3; */ private $sync_state = null; + /** + * Errors pertaining to the installation of Config Sync. + * + * Generated from protobuf field repeated .google.cloud.gkehub.configmanagement.v1.ConfigSyncError errors = 4; + */ + private $errors; + /** + * The state of the RootSync CRD + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState rootsync_crd = 5; + */ + private $rootsync_crd = 0; + /** + * The state of the Reposync CRD + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState reposync_crd = 6; + */ + private $reposync_crd = 0; + /** + * The state of CS + * This field summarizes the other fields in this message. + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State state = 7; + */ + private $state = 0; /** * Constructor. @@ -48,6 +73,15 @@ class ConfigSyncState extends \Google\Protobuf\Internal\Message * of the various Pods deployed * @type \Google\Cloud\GkeHub\ConfigManagement\V1\SyncState $sync_state * The state of ConfigSync's process to sync configs to a cluster + * @type array<\Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncError>|\Google\Protobuf\Internal\RepeatedField $errors + * Errors pertaining to the installation of Config Sync. + * @type int $rootsync_crd + * The state of the RootSync CRD + * @type int $reposync_crd + * The state of the Reposync CRD + * @type int $state + * The state of CS + * This field summarizes the other fields in this message. * } */ public function __construct($data = NULL) { @@ -165,5 +199,111 @@ public function setSyncState($var) return $this; } + /** + * Errors pertaining to the installation of Config Sync. + * + * Generated from protobuf field repeated .google.cloud.gkehub.configmanagement.v1.ConfigSyncError errors = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Errors pertaining to the installation of Config Sync. + * + * Generated from protobuf field repeated .google.cloud.gkehub.configmanagement.v1.ConfigSyncError errors = 4; + * @param array<\Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncError>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncError::class); + $this->errors = $arr; + + return $this; + } + + /** + * The state of the RootSync CRD + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState rootsync_crd = 5; + * @return int + */ + public function getRootsyncCrd() + { + return $this->rootsync_crd; + } + + /** + * The state of the RootSync CRD + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState rootsync_crd = 5; + * @param int $var + * @return $this + */ + public function setRootsyncCrd($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncState\CRDState::class); + $this->rootsync_crd = $var; + + return $this; + } + + /** + * The state of the Reposync CRD + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState reposync_crd = 6; + * @return int + */ + public function getReposyncCrd() + { + return $this->reposync_crd; + } + + /** + * The state of the Reposync CRD + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState reposync_crd = 6; + * @param int $var + * @return $this + */ + public function setReposyncCrd($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncState\CRDState::class); + $this->reposync_crd = $var; + + return $this; + } + + /** + * The state of CS + * This field summarizes the other fields in this message. + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State state = 7; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of CS + * This field summarizes the other fields in this message. + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State state = 7; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncState\State::class); + $this->state = $var; + + return $this; + } + } diff --git a/GkeHub/src/ConfigManagement/V1/ConfigSyncState/CRDState.php b/GkeHub/src/ConfigManagement/V1/ConfigSyncState/CRDState.php new file mode 100644 index 000000000000..2876176a286e --- /dev/null +++ b/GkeHub/src/ConfigManagement/V1/ConfigSyncState/CRDState.php @@ -0,0 +1,78 @@ +google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState + */ +class CRDState +{ + /** + * CRD's state cannot be determined + * + * Generated from protobuf enum CRD_STATE_UNSPECIFIED = 0; + */ + const CRD_STATE_UNSPECIFIED = 0; + /** + * CRD is not installed + * + * Generated from protobuf enum NOT_INSTALLED = 1; + */ + const NOT_INSTALLED = 1; + /** + * CRD is installed + * + * Generated from protobuf enum INSTALLED = 2; + */ + const INSTALLED = 2; + /** + * CRD is terminating (i.e., it has been deleted and is cleaning up) + * + * Generated from protobuf enum TERMINATING = 3; + */ + const TERMINATING = 3; + /** + * CRD is installing + * + * Generated from protobuf enum INSTALLING = 4; + */ + const INSTALLING = 4; + + private static $valueToName = [ + self::CRD_STATE_UNSPECIFIED => 'CRD_STATE_UNSPECIFIED', + self::NOT_INSTALLED => 'NOT_INSTALLED', + self::INSTALLED => 'INSTALLED', + self::TERMINATING => 'TERMINATING', + self::INSTALLING => 'INSTALLING', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CRDState::class, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncState_CRDState::class); + diff --git a/GkeHub/src/ConfigManagement/V1/ConfigSyncState/State.php b/GkeHub/src/ConfigManagement/V1/ConfigSyncState/State.php new file mode 100644 index 000000000000..090be33ad0df --- /dev/null +++ b/GkeHub/src/ConfigManagement/V1/ConfigSyncState/State.php @@ -0,0 +1,76 @@ +google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State + */ +class State +{ + /** + * CS's state cannot be determined. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * CS is not installed. + * + * Generated from protobuf enum CONFIG_SYNC_NOT_INSTALLED = 1; + */ + const CONFIG_SYNC_NOT_INSTALLED = 1; + /** + * The expected CS version is installed successfully. + * + * Generated from protobuf enum CONFIG_SYNC_INSTALLED = 2; + */ + const CONFIG_SYNC_INSTALLED = 2; + /** + * CS encounters errors. + * + * Generated from protobuf enum CONFIG_SYNC_ERROR = 3; + */ + const CONFIG_SYNC_ERROR = 3; + /** + * CS is installing or terminating. + * + * Generated from protobuf enum CONFIG_SYNC_PENDING = 4; + */ + const CONFIG_SYNC_PENDING = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CONFIG_SYNC_NOT_INSTALLED => 'CONFIG_SYNC_NOT_INSTALLED', + self::CONFIG_SYNC_INSTALLED => 'CONFIG_SYNC_INSTALLED', + self::CONFIG_SYNC_ERROR => 'CONFIG_SYNC_ERROR', + self::CONFIG_SYNC_PENDING => 'CONFIG_SYNC_PENDING', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncState_State::class); + diff --git a/GkeHub/src/ConfigManagement/V1/ConfigSyncVersion.php b/GkeHub/src/ConfigManagement/V1/ConfigSyncVersion.php index 5fc9ed4ef4c1..225c8935b4b4 100644 --- a/GkeHub/src/ConfigManagement/V1/ConfigSyncVersion.php +++ b/GkeHub/src/ConfigManagement/V1/ConfigSyncVersion.php @@ -51,6 +51,12 @@ class ConfigSyncVersion extends \Google\Protobuf\Internal\Message * Generated from protobuf field string root_reconciler = 6; */ private $root_reconciler = ''; + /** + * Version of the deployed admission_webhook pod + * + * Generated from protobuf field string admission_webhook = 7; + */ + private $admission_webhook = ''; /** * Constructor. @@ -70,6 +76,8 @@ class ConfigSyncVersion extends \Google\Protobuf\Internal\Message * Version of the deployed reconciler-manager pod * @type string $root_reconciler * Version of the deployed reconciler container in root-reconciler pod + * @type string $admission_webhook + * Version of the deployed admission_webhook pod * } */ public function __construct($data = NULL) { @@ -233,5 +241,31 @@ public function setRootReconciler($var) return $this; } + /** + * Version of the deployed admission_webhook pod + * + * Generated from protobuf field string admission_webhook = 7; + * @return string + */ + public function getAdmissionWebhook() + { + return $this->admission_webhook; + } + + /** + * Version of the deployed admission_webhook pod + * + * Generated from protobuf field string admission_webhook = 7; + * @param string $var + * @return $this + */ + public function setAdmissionWebhook($var) + { + GPBUtil::checkString($var, True); + $this->admission_webhook = $var; + + return $this; + } + } diff --git a/GkeHub/src/ConfigManagement/V1/DeploymentState.php b/GkeHub/src/ConfigManagement/V1/DeploymentState.php index 6f794bd6edb8..802546aeafdd 100644 --- a/GkeHub/src/ConfigManagement/V1/DeploymentState.php +++ b/GkeHub/src/ConfigManagement/V1/DeploymentState.php @@ -37,12 +37,19 @@ class DeploymentState * Generated from protobuf enum ERROR = 3; */ const ERROR = 3; + /** + * Deployment is installing or terminating + * + * Generated from protobuf enum PENDING = 4; + */ + const PENDING = 4; private static $valueToName = [ self::DEPLOYMENT_STATE_UNSPECIFIED => 'DEPLOYMENT_STATE_UNSPECIFIED', self::NOT_INSTALLED => 'NOT_INSTALLED', self::INSTALLED => 'INSTALLED', self::ERROR => 'ERROR', + self::PENDING => 'PENDING', ]; public static function name($value) diff --git a/GkeHub/src/ConfigManagement/V1/GitConfig.php b/GkeHub/src/ConfigManagement/V1/GitConfig.php index 717a0a549c5f..e5d364773df9 100644 --- a/GkeHub/src/ConfigManagement/V1/GitConfig.php +++ b/GkeHub/src/ConfigManagement/V1/GitConfig.php @@ -47,7 +47,9 @@ class GitConfig extends \Google\Protobuf\Internal\Message */ private $sync_rev = ''; /** - * Type of secret configured for access to the Git repo. + * Type of secret configured for access to the Git repo. Must be one of ssh, + * cookiefile, gcenode, token, gcpserviceaccount or none. The + * validation of this is case-sensitive. Required. * * Generated from protobuf field string secret_type = 6; */ @@ -59,7 +61,7 @@ class GitConfig extends \Google\Protobuf\Internal\Message */ private $https_proxy = ''; /** - * The GCP Service Account Email used for auth when secret_type is + * The Google Cloud Service Account Email used for auth when secret_type is * gcpServiceAccount. * * Generated from protobuf field string gcp_service_account_email = 8; @@ -84,11 +86,13 @@ class GitConfig extends \Google\Protobuf\Internal\Message * @type string $sync_rev * Git revision (tag or hash) to check out. Default HEAD. * @type string $secret_type - * Type of secret configured for access to the Git repo. + * Type of secret configured for access to the Git repo. Must be one of ssh, + * cookiefile, gcenode, token, gcpserviceaccount or none. The + * validation of this is case-sensitive. Required. * @type string $https_proxy * URL for the HTTPS proxy to be used when communicating with the Git repo. * @type string $gcp_service_account_email - * The GCP Service Account Email used for auth when secret_type is + * The Google Cloud Service Account Email used for auth when secret_type is * gcpServiceAccount. * } */ @@ -230,7 +234,9 @@ public function setSyncRev($var) } /** - * Type of secret configured for access to the Git repo. + * Type of secret configured for access to the Git repo. Must be one of ssh, + * cookiefile, gcenode, token, gcpserviceaccount or none. The + * validation of this is case-sensitive. Required. * * Generated from protobuf field string secret_type = 6; * @return string @@ -241,7 +247,9 @@ public function getSecretType() } /** - * Type of secret configured for access to the Git repo. + * Type of secret configured for access to the Git repo. Must be one of ssh, + * cookiefile, gcenode, token, gcpserviceaccount or none. The + * validation of this is case-sensitive. Required. * * Generated from protobuf field string secret_type = 6; * @param string $var @@ -282,7 +290,7 @@ public function setHttpsProxy($var) } /** - * The GCP Service Account Email used for auth when secret_type is + * The Google Cloud Service Account Email used for auth when secret_type is * gcpServiceAccount. * * Generated from protobuf field string gcp_service_account_email = 8; @@ -294,7 +302,7 @@ public function getGcpServiceAccountEmail() } /** - * The GCP Service Account Email used for auth when secret_type is + * The Google Cloud Service Account Email used for auth when secret_type is * gcpServiceAccount. * * Generated from protobuf field string gcp_service_account_email = 8; diff --git a/GkeHub/src/ConfigManagement/V1/MembershipSpec.php b/GkeHub/src/ConfigManagement/V1/MembershipSpec.php index ef9e63ffe840..c57d8bf30be6 100644 --- a/GkeHub/src/ConfigManagement/V1/MembershipSpec.php +++ b/GkeHub/src/ConfigManagement/V1/MembershipSpec.php @@ -40,6 +40,24 @@ class MembershipSpec extends \Google\Protobuf\Internal\Message * Generated from protobuf field string version = 10; */ private $version = ''; + /** + * The user-specified cluster name used by Config Sync cluster-name-selector + * annotation or ClusterSelector, for applying configs to only a subset + * of clusters. + * Omit this field if the cluster's fleet membership name is used by Config + * Sync cluster-name-selector annotation or ClusterSelector. + * Set this field if a name different from the cluster's fleet membership name + * is used by Config Sync cluster-name-selector annotation or ClusterSelector. + * + * Generated from protobuf field string cluster = 11; + */ + private $cluster = ''; + /** + * Enables automatic Feature management. + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management management = 12; + */ + private $management = 0; /** * Constructor. @@ -55,6 +73,16 @@ class MembershipSpec extends \Google\Protobuf\Internal\Message * Hierarchy Controller configuration for the cluster. * @type string $version * Version of ACM installed. + * @type string $cluster + * The user-specified cluster name used by Config Sync cluster-name-selector + * annotation or ClusterSelector, for applying configs to only a subset + * of clusters. + * Omit this field if the cluster's fleet membership name is used by Config + * Sync cluster-name-selector annotation or ClusterSelector. + * Set this field if a name different from the cluster's fleet membership name + * is used by Config Sync cluster-name-selector annotation or ClusterSelector. + * @type int $management + * Enables automatic Feature management. * } */ public function __construct($data = NULL) { @@ -196,5 +224,69 @@ public function setVersion($var) return $this; } + /** + * The user-specified cluster name used by Config Sync cluster-name-selector + * annotation or ClusterSelector, for applying configs to only a subset + * of clusters. + * Omit this field if the cluster's fleet membership name is used by Config + * Sync cluster-name-selector annotation or ClusterSelector. + * Set this field if a name different from the cluster's fleet membership name + * is used by Config Sync cluster-name-selector annotation or ClusterSelector. + * + * Generated from protobuf field string cluster = 11; + * @return string + */ + public function getCluster() + { + return $this->cluster; + } + + /** + * The user-specified cluster name used by Config Sync cluster-name-selector + * annotation or ClusterSelector, for applying configs to only a subset + * of clusters. + * Omit this field if the cluster's fleet membership name is used by Config + * Sync cluster-name-selector annotation or ClusterSelector. + * Set this field if a name different from the cluster's fleet membership name + * is used by Config Sync cluster-name-selector annotation or ClusterSelector. + * + * Generated from protobuf field string cluster = 11; + * @param string $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkString($var, True); + $this->cluster = $var; + + return $this; + } + + /** + * Enables automatic Feature management. + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management management = 12; + * @return int + */ + public function getManagement() + { + return $this->management; + } + + /** + * Enables automatic Feature management. + * + * Generated from protobuf field .google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management management = 12; + * @param int $var + * @return $this + */ + public function setManagement($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\ConfigManagement\V1\MembershipSpec\Management::class); + $this->management = $var; + + return $this; + } + } diff --git a/GkeHub/src/ConfigManagement/V1/MembershipSpec/Management.php b/GkeHub/src/ConfigManagement/V1/MembershipSpec/Management.php new file mode 100644 index 000000000000..a7e4823ee480 --- /dev/null +++ b/GkeHub/src/ConfigManagement/V1/MembershipSpec/Management.php @@ -0,0 +1,64 @@ +google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management + */ +class Management +{ + /** + * Unspecified + * + * Generated from protobuf enum MANAGEMENT_UNSPECIFIED = 0; + */ + const MANAGEMENT_UNSPECIFIED = 0; + /** + * Google will manage the Feature for the cluster. + * + * Generated from protobuf enum MANAGEMENT_AUTOMATIC = 1; + */ + const MANAGEMENT_AUTOMATIC = 1; + /** + * User will manually manage the Feature for the cluster. + * + * Generated from protobuf enum MANAGEMENT_MANUAL = 2; + */ + const MANAGEMENT_MANUAL = 2; + + private static $valueToName = [ + self::MANAGEMENT_UNSPECIFIED => 'MANAGEMENT_UNSPECIFIED', + self::MANAGEMENT_AUTOMATIC => 'MANAGEMENT_AUTOMATIC', + self::MANAGEMENT_MANUAL => 'MANAGEMENT_MANUAL', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Management::class, \Google\Cloud\GkeHub\ConfigManagement\V1\MembershipSpec_Management::class); + diff --git a/GkeHub/src/ConfigManagement/V1/MembershipState.php b/GkeHub/src/ConfigManagement/V1/MembershipState.php index 29ab7a335e05..1c49fbcd7484 100644 --- a/GkeHub/src/ConfigManagement/V1/MembershipState.php +++ b/GkeHub/src/ConfigManagement/V1/MembershipState.php @@ -16,11 +16,8 @@ class MembershipState extends \Google\Protobuf\Internal\Message { /** - * The user-defined name for the cluster used by ClusterSelectors to group - * clusters together. This should match Membership's membership_name, - * unless the user installed ACM on the cluster manually prior to enabling - * the ACM hub feature. - * Unique within a Anthos Config Management installation. + * This field is set to the `cluster_name` field of the Membership Spec if it + * is not empty. Otherwise, it is set to the cluster's fleet membership name. * * Generated from protobuf field string cluster_name = 1; */ @@ -65,11 +62,8 @@ class MembershipState extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $cluster_name - * The user-defined name for the cluster used by ClusterSelectors to group - * clusters together. This should match Membership's membership_name, - * unless the user installed ACM on the cluster manually prior to enabling - * the ACM hub feature. - * Unique within a Anthos Config Management installation. + * This field is set to the `cluster_name` field of the Membership Spec if it + * is not empty. Otherwise, it is set to the cluster's fleet membership name. * @type \Google\Cloud\GkeHub\ConfigManagement\V1\MembershipSpec $membership_spec * Membership configuration in the cluster. This represents the actual state * in the cluster, while the MembershipSpec in the FeatureSpec represents @@ -90,11 +84,8 @@ public function __construct($data = NULL) { } /** - * The user-defined name for the cluster used by ClusterSelectors to group - * clusters together. This should match Membership's membership_name, - * unless the user installed ACM on the cluster manually prior to enabling - * the ACM hub feature. - * Unique within a Anthos Config Management installation. + * This field is set to the `cluster_name` field of the Membership Spec if it + * is not empty. Otherwise, it is set to the cluster's fleet membership name. * * Generated from protobuf field string cluster_name = 1; * @return string @@ -105,11 +96,8 @@ public function getClusterName() } /** - * The user-defined name for the cluster used by ClusterSelectors to group - * clusters together. This should match Membership's membership_name, - * unless the user installed ACM on the cluster manually prior to enabling - * the ACM hub feature. - * Unique within a Anthos Config Management installation. + * This field is set to the `cluster_name` field of the Membership Spec if it + * is not empty. Otherwise, it is set to the cluster's fleet membership name. * * Generated from protobuf field string cluster_name = 1; * @param string $var diff --git a/GkeHub/src/ConfigManagement/V1/OciConfig.php b/GkeHub/src/ConfigManagement/V1/OciConfig.php new file mode 100644 index 000000000000..06b54e0babd0 --- /dev/null +++ b/GkeHub/src/ConfigManagement/V1/OciConfig.php @@ -0,0 +1,215 @@ +google.cloud.gkehub.configmanagement.v1.OciConfig + */ +class OciConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The OCI image repository URL for the package to sync from. + * e.g. `LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME`. + * + * Generated from protobuf field string sync_repo = 1; + */ + private $sync_repo = ''; + /** + * The absolute path of the directory that contains + * the local resources. Default: the root directory of the image. + * + * Generated from protobuf field string policy_dir = 2; + */ + private $policy_dir = ''; + /** + * Period in seconds between consecutive syncs. Default: 15. + * + * Generated from protobuf field int64 sync_wait_secs = 3; + */ + private $sync_wait_secs = 0; + /** + * Type of secret configured for access to the Git repo. + * + * Generated from protobuf field string secret_type = 4; + */ + private $secret_type = ''; + /** + * The Google Cloud Service Account Email used for auth when secret_type is + * gcpServiceAccount. + * + * Generated from protobuf field string gcp_service_account_email = 5; + */ + private $gcp_service_account_email = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sync_repo + * The OCI image repository URL for the package to sync from. + * e.g. `LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME`. + * @type string $policy_dir + * The absolute path of the directory that contains + * the local resources. Default: the root directory of the image. + * @type int|string $sync_wait_secs + * Period in seconds between consecutive syncs. Default: 15. + * @type string $secret_type + * Type of secret configured for access to the Git repo. + * @type string $gcp_service_account_email + * The Google Cloud Service Account Email used for auth when secret_type is + * gcpServiceAccount. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Configmanagement\Configmanagement::initOnce(); + parent::__construct($data); + } + + /** + * The OCI image repository URL for the package to sync from. + * e.g. `LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME`. + * + * Generated from protobuf field string sync_repo = 1; + * @return string + */ + public function getSyncRepo() + { + return $this->sync_repo; + } + + /** + * The OCI image repository URL for the package to sync from. + * e.g. `LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME`. + * + * Generated from protobuf field string sync_repo = 1; + * @param string $var + * @return $this + */ + public function setSyncRepo($var) + { + GPBUtil::checkString($var, True); + $this->sync_repo = $var; + + return $this; + } + + /** + * The absolute path of the directory that contains + * the local resources. Default: the root directory of the image. + * + * Generated from protobuf field string policy_dir = 2; + * @return string + */ + public function getPolicyDir() + { + return $this->policy_dir; + } + + /** + * The absolute path of the directory that contains + * the local resources. Default: the root directory of the image. + * + * Generated from protobuf field string policy_dir = 2; + * @param string $var + * @return $this + */ + public function setPolicyDir($var) + { + GPBUtil::checkString($var, True); + $this->policy_dir = $var; + + return $this; + } + + /** + * Period in seconds between consecutive syncs. Default: 15. + * + * Generated from protobuf field int64 sync_wait_secs = 3; + * @return int|string + */ + public function getSyncWaitSecs() + { + return $this->sync_wait_secs; + } + + /** + * Period in seconds between consecutive syncs. Default: 15. + * + * Generated from protobuf field int64 sync_wait_secs = 3; + * @param int|string $var + * @return $this + */ + public function setSyncWaitSecs($var) + { + GPBUtil::checkInt64($var); + $this->sync_wait_secs = $var; + + return $this; + } + + /** + * Type of secret configured for access to the Git repo. + * + * Generated from protobuf field string secret_type = 4; + * @return string + */ + public function getSecretType() + { + return $this->secret_type; + } + + /** + * Type of secret configured for access to the Git repo. + * + * Generated from protobuf field string secret_type = 4; + * @param string $var + * @return $this + */ + public function setSecretType($var) + { + GPBUtil::checkString($var, True); + $this->secret_type = $var; + + return $this; + } + + /** + * The Google Cloud Service Account Email used for auth when secret_type is + * gcpServiceAccount. + * + * Generated from protobuf field string gcp_service_account_email = 5; + * @return string + */ + public function getGcpServiceAccountEmail() + { + return $this->gcp_service_account_email; + } + + /** + * The Google Cloud Service Account Email used for auth when secret_type is + * gcpServiceAccount. + * + * Generated from protobuf field string gcp_service_account_email = 5; + * @param string $var + * @return $this + */ + public function setGcpServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->gcp_service_account_email = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/ConfigManagement/V1/SyncState/SyncCode.php b/GkeHub/src/ConfigManagement/V1/SyncState/SyncCode.php index 075ab45248eb..79c8f38a8fd7 100644 --- a/GkeHub/src/ConfigManagement/V1/SyncState/SyncCode.php +++ b/GkeHub/src/ConfigManagement/V1/SyncState/SyncCode.php @@ -7,45 +7,44 @@ use UnexpectedValueException; /** - * An enum representing an ACM's status syncing configs to a cluster + * An enum representing Config Sync's status of syncing configs to a cluster. * * Protobuf type google.cloud.gkehub.configmanagement.v1.SyncState.SyncCode */ class SyncCode { /** - * ACM cannot determine a sync code + * Config Sync cannot determine a sync code * * Generated from protobuf enum SYNC_CODE_UNSPECIFIED = 0; */ const SYNC_CODE_UNSPECIFIED = 0; /** - * ACM successfully synced the git Repo with the cluster + * Config Sync successfully synced the git Repo with the cluster * * Generated from protobuf enum SYNCED = 1; */ const SYNCED = 1; /** - * ACM is in the progress of syncing a new change + * Config Sync is in the progress of syncing a new change * * Generated from protobuf enum PENDING = 2; */ const PENDING = 2; /** - * Indicates an error configuring ACM, and user action is required + * Indicates an error configuring Config Sync, and user action is required * * Generated from protobuf enum ERROR = 3; */ const ERROR = 3; /** - * ACM has been installed (operator manifest deployed), - * but not configured. + * Config Sync has been installed but not configured * * Generated from protobuf enum NOT_CONFIGURED = 4; */ const NOT_CONFIGURED = 4; /** - * ACM has not been installed (no operator pod found) + * Config Sync has not been installed * * Generated from protobuf enum NOT_INSTALLED = 5; */