tencent cloud

文档反馈

StartStopServiceOrMonitor

最后更新时间:2024-01-09 10:47:28

    1. API Description

    Domain name for API request: emr.tencentcloudapi.com.

    This API is used to start, stop, or restart services.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: StartStopServiceOrMonitor.
    Version Yes String Common Params. The value used for this API: 2019-01-03.
    Region No String Common Params. This parameter is not required for this API.
    InstanceId Yes String The cluster ID.
    OpType Yes String The operation type. Valid values:
  • StartService: Start service
  • StopService: Stop service
  • StartMonitor: Start maintenance
  • StopMonitor: Stop maintenance
  • RestartService: Restart service. If this type is selected, "StrategyConfig" is required.
  • OpScope Yes OpScope The operation scope.
    StrategyConfig No StrategyConfig The operation policy.

    3. Output Parameters

    Parameter Name Type Description
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 StartStopServiceOrMonitor

    This example shows you how to start and stop cluster services.

    Input Example

    POST / HTTP/1.1
    Host: emr.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: StartStopServiceOrMonitor
    <Common request parameters>
    
    {
        "InstanceId": "emr-4zvc5mul",
        "OpType": "StartService",
        "OpScope": {
            "ServiceInfoList": [
                {
                    "ServiceName": "abc",
                    "ComponentInfoList": [
                        {
                            "ComponentName": "ZKFailoverController",
                            "IpList": [
                                "172.16.114.126"
                            ]
                        }
                    ]
                }
            ]
        },
        "StrategyConfig": {
            "RollingRestartSwitch": 0,
            "BatchSize": 1,
            "TimeWait": 5,
            "DealOnFail": 0
        }
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "4c141dbb-b365-4c1b-a209-2c18e47fdb11"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation Operation failed.
    InternalError.CamCgwError An error occurred while calling another service API.
    InternalError.WoodServerError An error occurred while calling another service API.
    InvalidParameter.InvalidInstanceName Invalid cluster name.
    InvalidParameter.InvalidJobFlow Invalid process task.
    ResourceInUse.InstanceInProcess The instance is under workflow.
    ResourceNotFound.InstanceNotFound The instance was not found.
    UnauthorizedOperation.CheckCamAuth Unauthorized operation.
    UnsupportedOperation.ServiceNotSupport This operation is not supported.