scenario:
  id: e5766f00-64fe-4c42-9660-ae39649a9ab8
  context:
    auth:
      type: digest
    base_path: /v1beta1
    host: null
  description: only 1 read API(clusters:showNodeQuota) can access(200), other read APIs are forbidden(403) 
  name: rbac_v1beta1_aws_1_read_403
steps:
  - operation_id: RegionService_ListRegions
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/regions?projectId={projectId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "path_params": {
          "projectId": "project_id"
        },
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 0
  - operation_id: RegionService_ShowCloudProviders
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/regions:showCloudProviders?projectId={projectId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "path_params": {
          "projectId": "project_id"
        },
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 1
  - operation_id: RegionService_GetRegion
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/regions/{regionId}?projectId={projectId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "regionId": "region_id",
          "projectId": "project_id"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 2
  - operation_id: RegionService_ListNodeSpecs
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/regions/{regionId}/nodeSpecs?projectId={projectId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "regionId": "region_id",
          "projectId": "project_id"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 3
  - operation_id: RegionService_GetNodeSpec
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/regions/{regionId}/componentTypes/TIDB/nodeSpecs/2C8G?projectId={projectId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "regionId": "region_id",
          "projectId": "project_id"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 4
  - operation_id: ClusterService_CreateCluster
    request_type: http
    request: |-
      {
        "method": "POST",
        "path": "/clusters",
        "headers": {},
        "query_params": {},
        "body": {
          "displayName": "sce-rbac-v1beta1-aws-read-403",
          "regionId": "{regionId}",
          "labels": {
            "tidb.cloud/project": "{projectId}"
          },
          "tidbNodeSetting": {
            "nodeSpecKey": "2C8G",
            "tidbNodeGroups": [
              {
                "nodeCount": 1
              }
            ]
          },
          "tikvNodeSetting": {
            "nodeCount": 3,
            "nodeSpecKey": "2C8G",
            "storageSizeGi": 200,
            "storageType": "Standard"
          },
          "port": 4000,
          "rootPassword": "MyPassword123!"
        },
        "auth": {
          "auth_type": "digest",
          "auth_role": "resource_apikey"
        },
        "body_params": {
          "regionId": "region_id",
          "projectId": "project_id"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    save: |-
      {
        "placeholder": [
          {
            "key": "cluster_1",
            "eval": "body.clusterId"
          }
        ]
      }
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 5
  - operation_id: ClusterService_GetCluster
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "resource_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == 'ACTIVE'"
      }
    save: null
    description: ""
    max_retries: 60
    delay_after: 30
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 5.5
  - operation_id: NetworkContainerService_CreateVpcPeering
    request_type: http
    request: |-
      {
        "method": "POST",
        "path": "/vpcPeerings",
        "headers": {},
        "query_params": {},
        "body": {
          "tidbCloudRegionId": "aws-us-west-2",
          "customerRegionId": "aws-us-west-2",
          "customerAccountId": "024848481520",
          "customerVpcId": "vpc-0393f150b4eb1a955",
          "customerVpcCidr": "10.0.0.0/16",
          "labels":{
            "tidb.cloud/project":"{projectId}"
          }
        },
        "body_params": {
          "projectId": "project_id"
        },
        "auth": {
          "auth_type": "digest",
          "auth_role": "resource_apikey"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    save: |-
      {
        "placeholder": [
          {
            "key": "vpcpeering_1",
            "eval": "body.vpcPeeringId"
          },
          {
            "key": "tidbcloudregion_1",
            "eval": "body.tidbCloudRegionId"
          },
          {
            "key": "customerregion_1",
            "eval": "body.customerRegionId"
          },
          {
            "key": "customeraccount_1",
            "eval": "body.customerAccountId"
          },
          {
            "key": "customervpc_1",
            "eval": "body.customerVpcId"
          }
        ]
      }
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 5.6
  - operation_id: NetworkContainerService_ListNetworkContainers
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/networkContainers?projectId={projectId}&cloudProvider=aws",
        "path_params": {
          "projectId": "project_id"
        },
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "resource_apikey"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    save: |-
      {
        "placeholder": [
          {
            "key": "networkcontainer_1",
            "eval": "body.networkContainers[0].networkContainerId"
          }
        ]
      }
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 5.7
  - operation_id: ClusterService_GetCluster
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 6
  - operation_id: ClusterService_ListClusters
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters?projectId={projectId}",
        "path_params": {
          "projectId": "project_id"
        },      
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 7
  - operation_id: ClusterService_ListNodeInstances
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/nodeInstances",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 8
  - operation_id: ClusterService_GetNodeInstance
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/nodeInstances/tidb-0",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 9
  - operation_id: ClusterService_ShowNodeQuota
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters:showNodeQuota",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 10
  - operation_id: ClusterService_GetLogRedactionPolicy
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/logRedactionPolicy",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 11
  - operation_id: TidbNodeGroupService_ListTidbNodeGroups
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/tidbNodeGroups",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 12
  - operation_id: TidbNodeGroupService_GetTidbNodeGroup
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/tidbNodeGroups/123",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 13
  - operation_id: TidbNodeGroupService_GetPublicEndpointSetting
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/tidbNodeGroups/123/publicEndpointSetting",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 14
  - operation_id: PrivateEndpointConnectionService_GetPrivateLinkService
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/tidbNodeGroups/123/privateLinkService",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 15
  # - operation_id: PrivateEndpointConnectionService_ListPrivateEndpointConnections
  #   request_type: http
  #   request: |-
  #     {
  #       "method": "GET",
  #       "path": "/clusters/{clusterId}/tidbNodeGroups/123/privateEndpointConnections",
  #       "headers": {},
  #       "query_params": {},
  #       "body": {},
  #       "auth": {
  #         "auth_type": "digest",
  #         "auth_role": "target_apikey"
  #       },
  #       "path_params": {
  #         "clusterId": "cluster_1"
  #       }
  #     }
  #   expect: |-
  #     {
  #       "status_code": 403,
  #       "cel": ""
  #     }
  #   save: |-
  #     {
  #       "placeholder": [
  #         {
  #           "key": "privateendpointconnection_1",
  #           "eval": "body.privateEndpointConnections[0].privateEndpointConnectionId"
  #         }
  #       ]
  #     }
  #   description: ''
  #   max_retries: 0
  #   delay_after: 0
  #   name: ''
  #   continue_on_unexpected: false
  #   stage: ''
  #   meta: '{}'
  #   generation_id: ''
  #   order: 16
  # - operation_id: PrivateEndpointConnectionService_GetPrivateEndpointConnection
  #   request_type: http
  #   request: |-
  #     {
  #       "method": "GET",
  #       "path": "/clusters/{clusterId}/tidbNodeGroups/123/privateEndpointConnections/{privateEndpointConnectionId}",
  #       "headers": {},
  #       "query_params": {},
  #       "body": {},
  #       "auth": {
  #         "auth_type": "digest",
  #         "auth_role": "target_apikey"
  #       },
  #       "path_params": {
  #         "clusterId": "cluster_1",
  #         "privateEndpointConnectionId": "privateendpointconnection_1"
  #       }
  #     }
  #   expect: |-
  #     {
  #       "status_code": 403,
  #       "cel": ""
  #     }
  #   save: null
  #   description: ''
  #   max_retries: 0
  #   delay_after: 0
  #   name: ''
  #   continue_on_unexpected: false
  #   stage: ''
  #   meta: '{}'
  #   generation_id: ''
  #   order: 17
  - operation_id: NetworkContainerService_ListNetworkContainers
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/networkContainers?projectId={projectId}&cloudProvider=aws",
        "path_params": {
          "projectId": "project_id"
        },
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 18
  - operation_id: NetworkContainerService_GetNetworkContainer
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/networkContainers/{networkContainerId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "networkContainerId": "networkcontainer_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 19
  - operation_id: NetworkContainerService_ListVpcPeerings
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/vpcPeerings?projectId={projectId}&cloudProvider=aws",
        "path_params": {
          "projectId": "project_id"
        },
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 20
  - operation_id: NetworkContainerService_GetVpcPeering
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/vpcPeerings/{vpcPeeringId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "vpcPeeringId": "vpcpeering_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 20.5
  - operation_id: MaintenanceService_ListMaintenanceWindows
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/maintenanceWindows?projectId={projectId}",
        "path_params": {
          "projectId": "project_id"
        },
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 21
  - operation_id: MaintenanceService_ListMaintenanceTasks
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/maintenanceTasks?projectId={projectId}",
        "path_params": {
          "projectId": "project_id"
        },
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 22
  - operation_id: DatabaseAuditLogService_GetAuditLogConfig
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/auditLogConfig",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 23
  - operation_id: DatabaseAuditLogService_ListAuditLogFilterRules
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/auditLogFilterRules",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 24
  - operation_id: DatabaseAuditLogService_ListAuditLogFilterRules
    request_type: http
    request: |-
      {
        "method": "GET",
        "path": "/clusters/{clusterId}/auditLogFilterRules",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "target_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 403,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 25
  - operation_id: ClusterService_DeleteCluster
    request_type: http
    request: |-
      {
        "method": "DELETE",
        "path": "/clusters/{clusterId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "resource_apikey"
        },
        "path_params": {
          "clusterId": "cluster_1"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    save: null
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 26
  - operation_id: NetworkContainerService_DeleteVpcPeering
    request_type: http
    request: |-
      {
        "method": "DELETE",
        "path": "/vpcPeerings/{vpvPeeringId}",
        "headers": {},
        "query_params": {},
        "body": {},
        "auth": {
          "auth_type": "digest",
          "auth_role": "resource_apikey"
        },
        "path_params": {
          "vpvPeeringId": "vpcpeering_1"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    description: ""
    max_retries: 0
    delay_after: 0
    name: ""
    continue_on_unexpected: false
    stage: ""
    meta: "{}"
    generation_id: ""
    order: 27
