Updated on 2022-02-22 GMT+08:00

Changing the Name of a Protection Group

Function

This API is used to change the name of a protection group.

Constraints and Limitations

None

URI

  • URI format

    PUT /v1/{project_id}/server-groups/{server_group_id}

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Specifies the project ID.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    server_group_id

    Yes

    String

    Specifies the ID of a protection group.

    For details, see Querying Protection Groups.

Request

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    server_group

    Yes

    Object

    Specifies the information about a protection group.

    For details, see Table 1.

    Table 1 server_group field description

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    String

    Specifies the name of a protection group.

    • The name can contain a maximum of 64 bytes.
    • The value can contain only letters (a to z and A to Z), digits (0 to 9), decimal points (.), underscores (_), and hyphens (-).
  • Example request
    PUT https://{endpoint}/v1/{project_id}/server-groups/ e98cefcd-2398-4a4d-8c52-c79f00e21484
    { 
         "server_group": { 
             "name": "my_test_server_group" 
         } 
     }

Response

  • Parameter description
    Table 2 Parameter description

    Parameter

    Type

    Description

    server_group

    Object

    Specifies the details of a protection group.

    For details, see Table 3.

    Table 3 server_group field description

    Parameter

    Type

    Description

    id

    String

    Specifies the ID of a protection group.

    name

    String

    Specifies the name of a protection group. The name can contain a maximum of 64 bytes. The value can contain only letters (a to z and A to Z), digits (0 to 9), decimal points (.), underscores (_), and hyphens (-).

    description

    String

    Specifies the description of a protection group.

    status

    String

    Specifies the status of a protection group.

    For details, see Protection Group Status.

    progress

    Integer

    Specifies the synchronization progress of a protection group.

    Unit: %

    source_availability_zone

    String

    Specifies the production site AZ configured when a protection group is created.

    The value does not change after a planned failover or failover.

    target_availability_zone

    String

    Specifies the DR site AZ configured when a protection group is created.

    The value does not change after a planned failover or failover.

    domain_id

    String

    Specifies the ID of an active-active domain.

    domain_name

    String

    Specifies the name of an active-active domain.

    protected_status

    String

    Specifies whether protection is enabled or not.

    • started: Protection is enabled.
    • stopped: Protection is disabled.

    replication_status

    String

    Specifies the data synchronization status.

    • active: Data has been synchronized.
    • inactive: Data is not synchronized.
    • copying: Data is being synchronized.
    • active-stopped: Data synchronization is stopped.

    health_status

    String

    Specifies the health status of a protection group.

    • normal: The protection group is normal.
    • abnormal: The protection group is abnormal.

    priority_station

    String

    Specifies the current production site of a protection group.

    • source: indicates that the current production site AZ is the source_availability_zone value.
    • target: indicates that the current production site AZ is the target_availability_zone value.

    protected_instance_num

    Integer

    Specifies the number of protected instances in a protection group.

    replication_num

    Integer

    Specifies the number of replication pairs in a protection group.

    disaster_recovery_drill_num

    Integer

    Specifies the number of DR drills in a protection group.

    source_vpc_id

    String

    Specifies the ID of the VPC for the production site.

    target_vpc_id

    String

    Specifies the ID of the VPC for the DR site.

    test_vpc_id

    String

    Specifies the ID of the VPC used for a DR drill.

    dr_type

    String

    Specifies the deployment model. The default value is migration, indicating migration within a VPC.

    server_type

    String

    Specifies the type of managed servers.

    • ECS: indicates that ECSs are managed.

    created_at

    String

    Specifies the time when a protection group was created.

    The default format is as follows: "yyyy-MM-dd HH:mm:ss.S", for example, 2019-04-01 12:00:00.0.

    updated_at

    String

    Specifies the time when a protection group was updated.

    The default format is as follows: "yyyy-MM-dd HH:mm:ss.S", for example, 2019-04-01 12:00:00.0.

    protection_type

    String

    Specifies the protection mode.

    • null: indicates that data synchronization is performed at the replication consistency group level. No partial synchronization failure will occur.
    • replication-pair: indicates that data synchronization is performed at the replication pair level.

    replication_model

    String

    Specifies the protection mode.

    NOTE:

    This parameter is reserved.

  • Example response
    {
       "server_group": {
           "id": "e98cefcd-2398-4a4d-8c52-c79f00e21484",
           "name": "my_test_server_group",
           "description": "test_server_group_sdrs",
           "status": "available",
           "progress": 0,
           "source_availability_zone": "cn-north-1a",
           "target_availability_zone": "cn-north-1b",
           "domain_id": "523ab8ad-3759-4933-9436-4cf4ebb20867",
           "domain_name": "my domain",
           "protected_status": "stopped",
           "replication_status": "active-stopped",
           "health_status": "normal",
           "priority_station": "source",
           "protected_instance_num": 0,
           "replication_num": 0,
           "disaster_recovery_drill_num": 0,  
           "source_vpc_id": "ac784bd6-a79c-4def-9ff8-dc87940d5335",
           "target_vpc_id": "ac784bd6-a79c-4def-9ff8-dc87940d5335",
           "test_vpc_id": null,
           "dr_type": "migration",
           "server_type":"ECS",
           "created_at": "2018-05-09 22:11:45.0",
           "updated_at": "2018-05-09 22:11:54.0",
           "protection_type": "replication-pair",
           "replication_model": null
       }
    }

    Or

    { 
         "error": { 
             "message": "XXXX",  
             "code": "XXX" 
         } 
     }

    In this example, error represents a general error, including badrequest (shown below) and itemNotFound.

    { 
         "badrequest": { 
             "message": "XXXX",  
             "code": "XXX" 
         } 
     }

Returned Values

  • Normal

    Returned Value

    Description

    200

    The server has accepted the request.

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    The server failed to process the request.

    401 Unauthorized

    You must enter a username and the password to access the requested page.

    403 Forbidden

    You are forbidden to access the requested page.

    404 Not Found

    The server could not find the requested page.

    405 Method Not Allowed

    You are not allowed to use the method specified in the request.

    406 Not Acceptable

    The response generated by the server could not be accepted by the client.

    407 Proxy Authentication Required

    You must use the proxy server for authentication so that the request can be processed.

    408 Request Timeout

    The request timed out.

    409 Conflict

    The request could not be processed due to a conflict.

    500 Internal Server Error

    Failed to complete the request because of a service error.

    501 Not Implemented

    Failed to complete the request because the server does not support the requested function.

    502 Bad Gateway

    Failed to complete the request because the server receives an invalid response from an upstream server.

    503 Service Unavailable

    Failed to complete the request because the system is unavailable.

    504 Gateway Timeout

    A gateway timeout error occurred.