diff --git a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/async_client.py b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/async_client.py index ba221a0cc4e8..5b3a091bebfe 100644 --- a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/async_client.py +++ b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/async_client.py @@ -1873,7 +1873,7 @@ async def sample_create_restore_plan(): The result type for the operation will be :class:`google.cloud.gke_backup_v1.types.RestorePlan` The configuration of a potential series of Restore operations to be performed against Backups belong to a particular BackupPlan. - Next id: 11 + Next id: 13 """ # Create or coerce a protobuf request object. @@ -2111,7 +2111,7 @@ async def sample_get_restore_plan(): The configuration of a potential series of Restore operations to be performed against Backups belong to a - particular BackupPlan. Next id: 11 + particular BackupPlan. Next id: 13 """ # Create or coerce a protobuf request object. @@ -2251,7 +2251,7 @@ async def sample_update_restore_plan(): The result type for the operation will be :class:`google.cloud.gke_backup_v1.types.RestorePlan` The configuration of a potential series of Restore operations to be performed against Backups belong to a particular BackupPlan. - Next id: 11 + Next id: 13 """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/client.py b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/client.py index eaa414d6ec6e..8d65c4c5d185 100644 --- a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/client.py +++ b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/client.py @@ -2204,7 +2204,7 @@ def sample_create_restore_plan(): The result type for the operation will be :class:`google.cloud.gke_backup_v1.types.RestorePlan` The configuration of a potential series of Restore operations to be performed against Backups belong to a particular BackupPlan. - Next id: 11 + Next id: 13 """ # Create or coerce a protobuf request object. @@ -2433,7 +2433,7 @@ def sample_get_restore_plan(): The configuration of a potential series of Restore operations to be performed against Backups belong to a - particular BackupPlan. Next id: 11 + particular BackupPlan. Next id: 13 """ # Create or coerce a protobuf request object. @@ -2564,7 +2564,7 @@ def sample_update_restore_plan(): The result type for the operation will be :class:`google.cloud.gke_backup_v1.types.RestorePlan` The configuration of a potential series of Restore operations to be performed against Backups belong to a particular BackupPlan. - Next id: 11 + Next id: 13 """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/transports/rest.py b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/transports/rest.py index 282d3dfb96c9..3e4a0162edaf 100644 --- a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/transports/rest.py +++ b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/services/backup_for_gke/transports/rest.py @@ -2232,7 +2232,7 @@ def __call__( The configuration of a potential series of Restore operations to be performed against Backups belong to a - particular BackupPlan. Next id: 11 + particular BackupPlan. Next id: 13 """ diff --git a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/backup_plan.py b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/backup_plan.py index 0574a58b7112..3c4c18399933 100644 --- a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/backup_plan.py +++ b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/backup_plan.py @@ -93,8 +93,47 @@ class BackupPlan(proto.Message): Output only. The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan. + state (google.cloud.gke_backup_v1.types.BackupPlan.State): + Output only. State of the BackupPlan. This + State field reflects the various stages a + BackupPlan can be in during the Create + operation. It will be set to "DEACTIVATED" if + the BackupPlan is deactivated on an Update + state_reason (str): + Output only. Human-readable description of why BackupPlan is + in the current ``state`` """ + class State(proto.Enum): + r"""State + + Values: + STATE_UNSPECIFIED (0): + Default first value for Enums. + CLUSTER_PENDING (1): + Waiting for cluster state to be RUNNING. + PROVISIONING (2): + The BackupPlan is in the process of being + created. + READY (3): + The BackupPlan has successfully been created + and is ready for Backups. + FAILED (4): + BackupPlan creation has failed. + DEACTIVATED (5): + The BackupPlan has been deactivated. + DELETING (6): + The BackupPlan is in the process of being + deleted. + """ + STATE_UNSPECIFIED = 0 + CLUSTER_PENDING = 1 + PROVISIONING = 2 + READY = 3 + FAILED = 4 + DEACTIVATED = 5 + DELETING = 6 + class RetentionPolicy(proto.Message): r"""RetentionPolicy defines a Backup retention policy for a BackupPlan. @@ -152,8 +191,8 @@ class RetentionPolicy(proto.Message): ) class Schedule(proto.Message): - r"""Schedule defines scheduling parameters for automatically - creating Backups via this BackupPlan. + r"""Defines scheduling parameters for automatically creating + Backups via this BackupPlan. Attributes: cron_schedule (str): @@ -315,6 +354,15 @@ class BackupConfig(proto.Message): proto.INT32, number=13, ) + state: State = proto.Field( + proto.ENUM, + number=14, + enum=State, + ) + state_reason: str = proto.Field( + proto.STRING, + number=15, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/restore.py b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/restore.py index e2d3f7f75c02..aace4b5cdc15 100644 --- a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/restore.py +++ b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/restore.py @@ -219,7 +219,7 @@ class State(proto.Enum): class RestoreConfig(proto.Message): r"""Configuration of a restore. - Next id: 9 + Next id: 12 This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -267,6 +267,18 @@ class RestoreConfig(proto.Message): all the resources to which they refer will be restored. + This field is a member of `oneof`_ ``namespaced_resource_restore_scope``. + no_namespaces (bool): + Do not restore any namespaced resources if + set to "True". Specifying this field to "False" + is not allowed. + + This field is a member of `oneof`_ ``namespaced_resource_restore_scope``. + excluded_namespaces (google.cloud.gke_backup_v1.types.Namespaces): + A list of selected namespaces excluded from + restoration. All namespaces except those in this + list will be restored. + This field is a member of `oneof`_ ``namespaced_resource_restore_scope``. substitution_rules (MutableSequence[google.cloud.gke_backup_v1.types.RestoreConfig.SubstitutionRule]): A list of transformation rules to be applied @@ -276,6 +288,14 @@ class RestoreConfig(proto.Message): matters, as changes made by a rule may impact the filtering logic of subsequent rules. An empty list means no substitution will occur. + transformation_rules (MutableSequence[google.cloud.gke_backup_v1.types.RestoreConfig.TransformationRule]): + A list of transformation rules to be applied + against Kubernetes resources as they are + selected for restoration from a Backup. Rules + are executed in order defined - this order + matters, as changes made by a rule may impact + the filtering logic of subsequent rules. An + empty list means no transformation will occur. """ class VolumeDataRestorePolicy(proto.Enum): @@ -416,6 +436,22 @@ class ClusterResourceRestoreScope(proto.Message): the selected resources will be restored. Mutually exclusive to any other field in the message. + excluded_group_kinds (MutableSequence[google.cloud.gke_backup_v1.types.RestoreConfig.GroupKind]): + A list of cluster-scoped resource group kinds + to NOT restore from the backup. If specified, + all valid cluster-scoped resources will be + restored except for those specified in the list. + Mutually exclusive to any other field in the + message. + all_group_kinds (bool): + If True, all valid cluster-scoped resources + will be restored. Mutually exclusive to any + other field in the message. + no_group_kinds (bool): + If True, no cluster-scoped resources will be + restored. This has the same restore scope as if + the message is not defined. Mutually exclusive + to any other field in the message. """ selected_group_kinds: MutableSequence[ @@ -425,6 +461,21 @@ class ClusterResourceRestoreScope(proto.Message): number=1, message="RestoreConfig.GroupKind", ) + excluded_group_kinds: MutableSequence[ + "RestoreConfig.GroupKind" + ] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="RestoreConfig.GroupKind", + ) + all_group_kinds: bool = proto.Field( + proto.BOOL, + number=3, + ) + no_group_kinds: bool = proto.Field( + proto.BOOL, + number=4, + ) class SubstitutionRule(proto.Message): r"""A transformation rule to be applied against Kubernetes @@ -503,6 +554,184 @@ class SubstitutionRule(proto.Message): number=5, ) + class TransformationRuleAction(proto.Message): + r"""TransformationRuleAction defines a TransformationRule action + based on the JSON Patch RFC + (https://www.rfc-editor.org/rfc/rfc6902) + + Attributes: + op (google.cloud.gke_backup_v1.types.RestoreConfig.TransformationRuleAction.Op): + Required. op specifies the operation to + perform. + from_path (str): + A string containing a JSON Pointer value that + references the location in the target document + to move the value from. + path (str): + A string containing a JSON-Pointer value that + references a location within the target document + where the operation is performed. + value (str): + A string that specifies the desired value in + string format to use for transformation. + """ + + class Op(proto.Enum): + r"""Possible values for operations of a transformation rule + action. + + Values: + OP_UNSPECIFIED (0): + Unspecified operation + REMOVE (1): + The "remove" operation removes the value at + the target location. + MOVE (2): + The "move" operation removes the value at a + specified location and adds it to the target + location. + COPY (3): + The "copy" operation copies the value at a + specified location to the target location. + ADD (4): + The "add" operation performs one of the + following functions, depending upon what the + target location references: 1. If the target + location specifies an array index, a new value + is inserted into the array at the specified + index. 2. If the target location specifies an + object member that does not already exist, a new + member is added to the object. 3. If the target + location specifies an object member that does + exist, that member's value is replaced. + TEST (5): + The "test" operation tests that a value at + the target location is equal to a specified + value. + REPLACE (6): + The "replace" operation replaces the value at + the target location with a new value. The + operation object MUST contain a "value" member + whose content specifies the replacement value. + """ + OP_UNSPECIFIED = 0 + REMOVE = 1 + MOVE = 2 + COPY = 3 + ADD = 4 + TEST = 5 + REPLACE = 6 + + op: "RestoreConfig.TransformationRuleAction.Op" = proto.Field( + proto.ENUM, + number=1, + enum="RestoreConfig.TransformationRuleAction.Op", + ) + from_path: str = proto.Field( + proto.STRING, + number=2, + ) + path: str = proto.Field( + proto.STRING, + number=3, + ) + value: str = proto.Field( + proto.STRING, + number=4, + ) + + class ResourceFilter(proto.Message): + r"""ResourceFilter specifies matching criteria to limit the scope + of a change to a specific set of kubernetes resources that are + selected for restoration from a backup. + + Attributes: + namespaces (MutableSequence[str]): + (Filtering parameter) Any resource subject to + transformation must be contained within one of + the listed Kubernetes Namespace in the Backup. + If this field is not provided, no namespace + filtering will be performed (all resources in + all Namespaces, including all cluster-scoped + resources, will be candidates for + transformation). + To mix cluster-scoped and namespaced resources + in the same rule, use an empty string ("") as + one of the target namespaces. + group_kinds (MutableSequence[google.cloud.gke_backup_v1.types.RestoreConfig.GroupKind]): + (Filtering parameter) Any resource subject to + transformation must belong to one of the listed + "types". If this field is not provided, no type + filtering will be performed (all resources of + all types matching previous filtering parameters + will be candidates for transformation). + json_path (str): + This is a [JSONPath] + (https://github.com/json-path/JsonPath/blob/master/README.md) + expression that matches specific fields of candidate + resources and it operates as a filtering parameter + (resources that are not matched with this expression will + not be candidates for transformation). + """ + + namespaces: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=1, + ) + group_kinds: MutableSequence["RestoreConfig.GroupKind"] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="RestoreConfig.GroupKind", + ) + json_path: str = proto.Field( + proto.STRING, + number=3, + ) + + class TransformationRule(proto.Message): + r"""A transformation rule to be applied against Kubernetes + resources as they are selected for restoration from a Backup. A + rule contains both filtering logic (which resources are subject + to transform) and transformation logic. + + Attributes: + field_actions (MutableSequence[google.cloud.gke_backup_v1.types.RestoreConfig.TransformationRuleAction]): + Required. A list of transformation rule + actions to take against candidate resources. + Actions are executed in order defined - this + order matters, as they could potentially + interfere with each other and the first + operation could affect the outcome of the second + operation. + resource_filter (google.cloud.gke_backup_v1.types.RestoreConfig.ResourceFilter): + This field is used to specify a set of fields + that should be used to determine which resources + in backup should be acted upon by the supplied + transformation rule actions, and this will + ensure that only specific resources are affected + by transformation rule actions. + description (str): + The description is a user specified string + description of the transformation rule. + """ + + field_actions: MutableSequence[ + "RestoreConfig.TransformationRuleAction" + ] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="RestoreConfig.TransformationRuleAction", + ) + resource_filter: "RestoreConfig.ResourceFilter" = proto.Field( + proto.MESSAGE, + number=2, + message="RestoreConfig.ResourceFilter", + ) + description: str = proto.Field( + proto.STRING, + number=3, + ) + volume_data_restore_policy: VolumeDataRestorePolicy = proto.Field( proto.ENUM, number=1, @@ -540,11 +769,27 @@ class SubstitutionRule(proto.Message): oneof="namespaced_resource_restore_scope", message=common.NamespacedNames, ) + no_namespaces: bool = proto.Field( + proto.BOOL, + number=9, + oneof="namespaced_resource_restore_scope", + ) + excluded_namespaces: common.Namespaces = proto.Field( + proto.MESSAGE, + number=10, + oneof="namespaced_resource_restore_scope", + message=common.Namespaces, + ) substitution_rules: MutableSequence[SubstitutionRule] = proto.RepeatedField( proto.MESSAGE, number=8, message=SubstitutionRule, ) + transformation_rules: MutableSequence[TransformationRule] = proto.RepeatedField( + proto.MESSAGE, + number=11, + message=TransformationRule, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/restore_plan.py b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/restore_plan.py index 232d8d14bd42..8a126ec9f422 100644 --- a/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/restore_plan.py +++ b/packages/google-cloud-gke-backup/google/cloud/gke_backup_v1/types/restore_plan.py @@ -33,7 +33,7 @@ class RestorePlan(proto.Message): r"""The configuration of a potential series of Restore operations to be performed against Backups belong to a particular - BackupPlan. Next id: 11 + BackupPlan. Next id: 13 Attributes: name (str): @@ -82,8 +82,39 @@ class RestorePlan(proto.Message): put that etag in the request to ``UpdateRestorePlan`` or ``DeleteRestorePlan`` to ensure that their change will be applied to the same version of the resource. + state (google.cloud.gke_backup_v1.types.RestorePlan.State): + Output only. State of the RestorePlan. This + State field reflects the various stages a + RestorePlan can be in during the Create + operation. + state_reason (str): + Output only. Human-readable description of why RestorePlan + is in the current ``state`` """ + class State(proto.Enum): + r"""State + + Values: + STATE_UNSPECIFIED (0): + Default first value for Enums. + CLUSTER_PENDING (1): + Waiting for cluster state to be RUNNING. + READY (2): + The RestorePlan has successfully been created + and is ready for Restores. + FAILED (3): + RestorePlan creation has failed. + DELETING (4): + The RestorePlan is in the process of being + deleted. + """ + STATE_UNSPECIFIED = 0 + CLUSTER_PENDING = 1 + READY = 2 + FAILED = 3 + DELETING = 4 + name: str = proto.Field( proto.STRING, number=1, @@ -128,6 +159,15 @@ class RestorePlan(proto.Message): proto.STRING, number=10, ) + state: State = proto.Field( + proto.ENUM, + number=11, + enum=State, + ) + state_reason: str = proto.Field( + proto.STRING, + number=12, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-gke-backup/samples/generated_samples/snippet_metadata_google.cloud.gkebackup.v1.json b/packages/google-cloud-gke-backup/samples/generated_samples/snippet_metadata_google.cloud.gkebackup.v1.json index f85c470946f6..7a6f9c3719c1 100644 --- a/packages/google-cloud-gke-backup/samples/generated_samples/snippet_metadata_google.cloud.gkebackup.v1.json +++ b/packages/google-cloud-gke-backup/samples/generated_samples/snippet_metadata_google.cloud.gkebackup.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-gke-backup", - "version": "0.4.4" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-gke-backup/tests/unit/gapic/gke_backup_v1/test_backup_for_gke.py b/packages/google-cloud-gke-backup/tests/unit/gapic/gke_backup_v1/test_backup_for_gke.py index e15e456ed7f9..690cf72a532a 100644 --- a/packages/google-cloud-gke-backup/tests/unit/gapic/gke_backup_v1/test_backup_for_gke.py +++ b/packages/google-cloud-gke-backup/tests/unit/gapic/gke_backup_v1/test_backup_for_gke.py @@ -1449,6 +1449,8 @@ def test_get_backup_plan(request_type, transport: str = "grpc"): etag="etag_value", deactivated=True, protected_pod_count=2036, + state=backup_plan.BackupPlan.State.CLUSTER_PENDING, + state_reason="state_reason_value", ) response = client.get_backup_plan(request) @@ -1466,6 +1468,8 @@ def test_get_backup_plan(request_type, transport: str = "grpc"): assert response.etag == "etag_value" assert response.deactivated is True assert response.protected_pod_count == 2036 + assert response.state == backup_plan.BackupPlan.State.CLUSTER_PENDING + assert response.state_reason == "state_reason_value" def test_get_backup_plan_empty_call(): @@ -1509,6 +1513,8 @@ async def test_get_backup_plan_async( etag="etag_value", deactivated=True, protected_pod_count=2036, + state=backup_plan.BackupPlan.State.CLUSTER_PENDING, + state_reason="state_reason_value", ) ) response = await client.get_backup_plan(request) @@ -1527,6 +1533,8 @@ async def test_get_backup_plan_async( assert response.etag == "etag_value" assert response.deactivated is True assert response.protected_pod_count == 2036 + assert response.state == backup_plan.BackupPlan.State.CLUSTER_PENDING + assert response.state_reason == "state_reason_value" @pytest.mark.asyncio @@ -5037,6 +5045,8 @@ def test_get_restore_plan(request_type, transport: str = "grpc"): backup_plan="backup_plan_value", cluster="cluster_value", etag="etag_value", + state=restore_plan.RestorePlan.State.CLUSTER_PENDING, + state_reason="state_reason_value", ) response = client.get_restore_plan(request) @@ -5053,6 +5063,8 @@ def test_get_restore_plan(request_type, transport: str = "grpc"): assert response.backup_plan == "backup_plan_value" assert response.cluster == "cluster_value" assert response.etag == "etag_value" + assert response.state == restore_plan.RestorePlan.State.CLUSTER_PENDING + assert response.state_reason == "state_reason_value" def test_get_restore_plan_empty_call(): @@ -5095,6 +5107,8 @@ async def test_get_restore_plan_async( backup_plan="backup_plan_value", cluster="cluster_value", etag="etag_value", + state=restore_plan.RestorePlan.State.CLUSTER_PENDING, + state_reason="state_reason_value", ) ) response = await client.get_restore_plan(request) @@ -5112,6 +5126,8 @@ async def test_get_restore_plan_async( assert response.backup_plan == "backup_plan_value" assert response.cluster == "cluster_value" assert response.etag == "etag_value" + assert response.state == restore_plan.RestorePlan.State.CLUSTER_PENDING + assert response.state_reason == "state_reason_value" @pytest.mark.asyncio @@ -7920,6 +7936,8 @@ def test_create_backup_plan_rest(request_type): }, }, "protected_pod_count": 2036, + "state": 1, + "state_reason": "state_reason_value", } request = request_type(**request_init) @@ -8152,6 +8170,8 @@ def test_create_backup_plan_rest_bad_request( }, }, "protected_pod_count": 2036, + "state": 1, + "state_reason": "state_reason_value", } request = request_type(**request_init) @@ -8604,6 +8624,8 @@ def test_get_backup_plan_rest(request_type): etag="etag_value", deactivated=True, protected_pod_count=2036, + state=backup_plan.BackupPlan.State.CLUSTER_PENDING, + state_reason="state_reason_value", ) # Wrap the value into a proper Response obj @@ -8625,6 +8647,8 @@ def test_get_backup_plan_rest(request_type): assert response.etag == "etag_value" assert response.deactivated is True assert response.protected_pod_count == 2036 + assert response.state == backup_plan.BackupPlan.State.CLUSTER_PENDING + assert response.state_reason == "state_reason_value" def test_get_backup_plan_rest_required_fields( @@ -8908,6 +8932,8 @@ def test_update_backup_plan_rest(request_type): }, }, "protected_pod_count": 2036, + "state": 1, + "state_reason": "state_reason_value", } request = request_type(**request_init) @@ -9117,6 +9143,8 @@ def test_update_backup_plan_rest_bad_request( }, }, "protected_pod_count": 2036, + "state": 1, + "state_reason": "state_reason_value", } request = request_type(**request_init) @@ -11757,7 +11785,10 @@ def test_create_restore_plan_rest(request_type): "resource_group": "resource_group_value", "resource_kind": "resource_kind_value", } - ] + ], + "excluded_group_kinds": {}, + "all_group_kinds": True, + "no_group_kinds": True, }, "all_namespaces": True, "selected_namespaces": { @@ -11768,6 +11799,8 @@ def test_create_restore_plan_rest(request_type): {"namespace": "namespace_value", "name": "name_value"} ] }, + "no_namespaces": True, + "excluded_namespaces": {}, "substitution_rules": [ { "target_namespaces": [ @@ -11780,9 +11813,29 @@ def test_create_restore_plan_rest(request_type): "new_value": "new_value_value", } ], + "transformation_rules": [ + { + "field_actions": [ + { + "op": 1, + "from_path": "from_path_value", + "path": "path_value", + "value": "value_value", + } + ], + "resource_filter": { + "namespaces": ["namespaces_value1", "namespaces_value2"], + "group_kinds": {}, + "json_path": "json_path_value", + }, + "description": "description_value", + } + ], }, "labels": {}, "etag": "etag_value", + "state": 1, + "state_reason": "state_reason_value", } request = request_type(**request_init) @@ -12000,7 +12053,10 @@ def test_create_restore_plan_rest_bad_request( "resource_group": "resource_group_value", "resource_kind": "resource_kind_value", } - ] + ], + "excluded_group_kinds": {}, + "all_group_kinds": True, + "no_group_kinds": True, }, "all_namespaces": True, "selected_namespaces": { @@ -12011,6 +12067,8 @@ def test_create_restore_plan_rest_bad_request( {"namespace": "namespace_value", "name": "name_value"} ] }, + "no_namespaces": True, + "excluded_namespaces": {}, "substitution_rules": [ { "target_namespaces": [ @@ -12023,9 +12081,29 @@ def test_create_restore_plan_rest_bad_request( "new_value": "new_value_value", } ], + "transformation_rules": [ + { + "field_actions": [ + { + "op": 1, + "from_path": "from_path_value", + "path": "path_value", + "value": "value_value", + } + ], + "resource_filter": { + "namespaces": ["namespaces_value1", "namespaces_value2"], + "group_kinds": {}, + "json_path": "json_path_value", + }, + "description": "description_value", + } + ], }, "labels": {}, "etag": "etag_value", + "state": 1, + "state_reason": "state_reason_value", } request = request_type(**request_init) @@ -12479,6 +12557,8 @@ def test_get_restore_plan_rest(request_type): backup_plan="backup_plan_value", cluster="cluster_value", etag="etag_value", + state=restore_plan.RestorePlan.State.CLUSTER_PENDING, + state_reason="state_reason_value", ) # Wrap the value into a proper Response obj @@ -12499,6 +12579,8 @@ def test_get_restore_plan_rest(request_type): assert response.backup_plan == "backup_plan_value" assert response.cluster == "cluster_value" assert response.etag == "etag_value" + assert response.state == restore_plan.RestorePlan.State.CLUSTER_PENDING + assert response.state_reason == "state_reason_value" def test_get_restore_plan_rest_required_fields( @@ -12769,7 +12851,10 @@ def test_update_restore_plan_rest(request_type): "resource_group": "resource_group_value", "resource_kind": "resource_kind_value", } - ] + ], + "excluded_group_kinds": {}, + "all_group_kinds": True, + "no_group_kinds": True, }, "all_namespaces": True, "selected_namespaces": { @@ -12780,6 +12865,8 @@ def test_update_restore_plan_rest(request_type): {"namespace": "namespace_value", "name": "name_value"} ] }, + "no_namespaces": True, + "excluded_namespaces": {}, "substitution_rules": [ { "target_namespaces": [ @@ -12792,9 +12879,29 @@ def test_update_restore_plan_rest(request_type): "new_value": "new_value_value", } ], + "transformation_rules": [ + { + "field_actions": [ + { + "op": 1, + "from_path": "from_path_value", + "path": "path_value", + "value": "value_value", + } + ], + "resource_filter": { + "namespaces": ["namespaces_value1", "namespaces_value2"], + "group_kinds": {}, + "json_path": "json_path_value", + }, + "description": "description_value", + } + ], }, "labels": {}, "etag": "etag_value", + "state": 1, + "state_reason": "state_reason_value", } request = request_type(**request_init) @@ -12989,7 +13096,10 @@ def test_update_restore_plan_rest_bad_request( "resource_group": "resource_group_value", "resource_kind": "resource_kind_value", } - ] + ], + "excluded_group_kinds": {}, + "all_group_kinds": True, + "no_group_kinds": True, }, "all_namespaces": True, "selected_namespaces": { @@ -13000,6 +13110,8 @@ def test_update_restore_plan_rest_bad_request( {"namespace": "namespace_value", "name": "name_value"} ] }, + "no_namespaces": True, + "excluded_namespaces": {}, "substitution_rules": [ { "target_namespaces": [ @@ -13012,9 +13124,29 @@ def test_update_restore_plan_rest_bad_request( "new_value": "new_value_value", } ], + "transformation_rules": [ + { + "field_actions": [ + { + "op": 1, + "from_path": "from_path_value", + "path": "path_value", + "value": "value_value", + } + ], + "resource_filter": { + "namespaces": ["namespaces_value1", "namespaces_value2"], + "group_kinds": {}, + "json_path": "json_path_value", + }, + "description": "description_value", + } + ], }, "labels": {}, "etag": "etag_value", + "state": 1, + "state_reason": "state_reason_value", } request = request_type(**request_init) @@ -13410,7 +13542,10 @@ def test_create_restore_rest(request_type): "resource_group": "resource_group_value", "resource_kind": "resource_kind_value", } - ] + ], + "excluded_group_kinds": {}, + "all_group_kinds": True, + "no_group_kinds": True, }, "all_namespaces": True, "selected_namespaces": { @@ -13421,6 +13556,8 @@ def test_create_restore_rest(request_type): {"namespace": "namespace_value", "name": "name_value"} ] }, + "no_namespaces": True, + "excluded_namespaces": {}, "substitution_rules": [ { "target_namespaces": [ @@ -13433,6 +13570,24 @@ def test_create_restore_rest(request_type): "new_value": "new_value_value", } ], + "transformation_rules": [ + { + "field_actions": [ + { + "op": 1, + "from_path": "from_path_value", + "path": "path_value", + "value": "value_value", + } + ], + "resource_filter": { + "namespaces": ["namespaces_value1", "namespaces_value2"], + "group_kinds": {}, + "json_path": "json_path_value", + }, + "description": "description_value", + } + ], }, "labels": {}, "state": 1, @@ -13658,7 +13813,10 @@ def test_create_restore_rest_bad_request( "resource_group": "resource_group_value", "resource_kind": "resource_kind_value", } - ] + ], + "excluded_group_kinds": {}, + "all_group_kinds": True, + "no_group_kinds": True, }, "all_namespaces": True, "selected_namespaces": { @@ -13669,6 +13827,8 @@ def test_create_restore_rest_bad_request( {"namespace": "namespace_value", "name": "name_value"} ] }, + "no_namespaces": True, + "excluded_namespaces": {}, "substitution_rules": [ { "target_namespaces": [ @@ -13681,6 +13841,24 @@ def test_create_restore_rest_bad_request( "new_value": "new_value_value", } ], + "transformation_rules": [ + { + "field_actions": [ + { + "op": 1, + "from_path": "from_path_value", + "path": "path_value", + "value": "value_value", + } + ], + "resource_filter": { + "namespaces": ["namespaces_value1", "namespaces_value2"], + "group_kinds": {}, + "json_path": "json_path_value", + }, + "description": "description_value", + } + ], }, "labels": {}, "state": 1, @@ -14444,7 +14622,10 @@ def test_update_restore_rest(request_type): "resource_group": "resource_group_value", "resource_kind": "resource_kind_value", } - ] + ], + "excluded_group_kinds": {}, + "all_group_kinds": True, + "no_group_kinds": True, }, "all_namespaces": True, "selected_namespaces": { @@ -14455,6 +14636,8 @@ def test_update_restore_rest(request_type): {"namespace": "namespace_value", "name": "name_value"} ] }, + "no_namespaces": True, + "excluded_namespaces": {}, "substitution_rules": [ { "target_namespaces": [ @@ -14467,6 +14650,24 @@ def test_update_restore_rest(request_type): "new_value": "new_value_value", } ], + "transformation_rules": [ + { + "field_actions": [ + { + "op": 1, + "from_path": "from_path_value", + "path": "path_value", + "value": "value_value", + } + ], + "resource_filter": { + "namespaces": ["namespaces_value1", "namespaces_value2"], + "group_kinds": {}, + "json_path": "json_path_value", + }, + "description": "description_value", + } + ], }, "labels": {}, "state": 1, @@ -14669,7 +14870,10 @@ def test_update_restore_rest_bad_request( "resource_group": "resource_group_value", "resource_kind": "resource_kind_value", } - ] + ], + "excluded_group_kinds": {}, + "all_group_kinds": True, + "no_group_kinds": True, }, "all_namespaces": True, "selected_namespaces": { @@ -14680,6 +14884,8 @@ def test_update_restore_rest_bad_request( {"namespace": "namespace_value", "name": "name_value"} ] }, + "no_namespaces": True, + "excluded_namespaces": {}, "substitution_rules": [ { "target_namespaces": [ @@ -14692,6 +14898,24 @@ def test_update_restore_rest_bad_request( "new_value": "new_value_value", } ], + "transformation_rules": [ + { + "field_actions": [ + { + "op": 1, + "from_path": "from_path_value", + "path": "path_value", + "value": "value_value", + } + ], + "resource_filter": { + "namespaces": ["namespaces_value1", "namespaces_value2"], + "group_kinds": {}, + "json_path": "json_path_value", + }, + "description": "description_value", + } + ], }, "labels": {}, "state": 1,