리소스 재확보 사용

IBM Cloud® CLI 또는 IBM Cloud® 리소스 제어기 API를 사용하여 특정 리소스의 재확보 프로세스를 관리할 수 있습니다. 자세한 정보는 리소스에 관한 FAQ를 참고하세요

CLI를 사용하여 재확보된 리소스 나열

CLI를 사용하여 복원하거나 삭제할 수 있는 재확보된 리소스를 나열하려면 다음 명령을 실행하십시오.

ibmcloud resource reclamations [--resource-instance-id INSTANCE_ID]

다음 명령 옵션을 입력하십시오.

  • --resource-instance-id: 리소스 인스턴스의 GUID(Globally Unique ID)입니다.

다음 예는 특정 서비스 인스턴스의 재확보를 나열하는 방법을 보여줍니다.

ibmcloud resource reclamations --resource-instance-id abcd1234-ef56-486e-b293-22d6c7eb6699

API를 사용하여 재확보된 리소스 나열

복원되거나 삭제될 수 있는 재확보된 리소스 그룹을 나열하려면 다음 예에 표시된 대로 IBM Cloud® 리소스 제어기 API를 호출하십시오.

ListReclamationsOptions.Builder를 사용하여 ListReclamationsOptions 메소드에 대한 매개변수 값이 포함된 listReclamations 오브젝트를 작성하십시오.

ListReclamationsOptions 구조를 인스턴스화하고 ListReclamations 메소드에 대한 매개변수값을 제공하도록 필드를 설정하십시오.

curl -X GET https://resource-controller.cloud.ibm.com/v1/reclamations?account_id=b80a8b513ae24e178438b7a18bd8d609 -H 'Authorization: Bearer <IAM_TOKEN>'
ListReclamationsOptions listReclamationsOptions = new ListReclamationsOptions.Builder()
  .accountId(accountId)
  .build();

Response<ReclamationsList> response = service.listReclamations(listReclamationsOptions).execute();
ReclamationsList reclamationsList = response.getResult();

System.out.printf("listReclamations() response:\n%s\n", reclamationsList.toString());
const params = {
  accountId: accountId,
};

resourceControllerService.listReclamations(params)
  .then(res => {
    var resources = res.result.resources;
    resources.forEach(reclaim => {
      if (reclaim.resource_instance_id.toString() === instanceGuid) {
        reclamationId = reclaim.id;
      }
    });
    console.log('listReclamations() response:\n' + JSON.stringify(res.result, null, 2));
  })
  .catch(err => {
    console.warn(err)
  });
reclamations_list = resource_controller_service.list_reclamations(
    account_id=account_id
).get_result()

print('\nlist_reclamations() response:\n',
      json.dumps(reclamations_list, indent=2))
listReclamationsOptions := resourceControllerService.NewListReclamationsOptions()
listReclamationsOptions = listReclamationsOptions.SetAccountID(accountID)
reclamationsList, response, err := resourceControllerService.ListReclamations(listReclamationsOptions)
if err != nil {
  panic(err)
}
b, _ := json.MarshalIndent(reclamationsList, "", "  ")
fmt.Printf("\nListReclamations() response:\n%s\n", string(b))

CLI를 사용하여 재확보된 리소스 삭제

CLI를 사용하여 재확보된 리소스를 삭제하려면 다음 명령을 실행하십시오.

ibmcloud resource reclamation-delete ID [--comment COMMENT] [--f, --force]

다음 명령 옵션을 입력하십시오.

  • ID: 리소스 교정의 ID(NAME과 배타적)입니다 이는 리소스 인스턴스 ID가 아닌 재확보 ID입니다 (필수).
  • --comment: 조치에 대한 주석입니다.
  • -f, --force: 확인하지 않고 삭제를 강제 실행합니다.

다음 예는 ID가 d9fendfwlw인 리소스 재확보를 삭제하는 방법을 보여줍니다.

ibmcloud resource reclamation-delete "d9fendfwlw"

다음 예는 확인 없이 ID가 d9fendfwlw인 리소스 재확보를 삭제하고 no longer needed라는 주석을 남기는 방법을 보여줍니다.

ibmcloud resource reclamation-delete "d9fendfwlw" --comment "no longer needed" -f

API를 사용하여 리소스 삭제

리소스를 재확보(일시적으로 삭제)하려면 다음 예에 표시된 대로 IBM Cloud® 리소스 제어기 API를 호출하십시오. 리소스를 삭제하려면 reclaim을(를) 지정하십시오. id은(는) 리소스 인스턴스 ID가 아니라 재확보 ID입니다.

curl -X POST https://resource-controller.cloud.ibm.com/v1/reclamations/0114be9024c6eede47d08a85ac0c5c43/actions/reclaim -H 'Authorization: Bearer <IAM_TOKEN>' -H 'Content-Type: application/json' -d '{
    "request_by": "bar",
    "comment": "reclaim resource instance 614fc866-1d4f-4c9e-973e-637f1089a6a1"
  }'
RunReclamationActionOptions runReclamationActionOptions = new RunReclamationActionOptions.Builder()
  .id(reclamationId)
  .actionName("reclaim")
  .build();

Response<Reclamation> response = service.runReclamationAction(runReclamationActionOptions).execute();
Reclamation reclamation = response.getResult();

System.out.printf("runReclamationAction() response:\n%s\n", reclamation.toString());
const params = {
  id: reclamationId,
  actionName: 'reclaim',
};

resourceControllerService.runReclamationAction(params)
  .then(res => {
    console.log('runReclamationAction() response:\n' + JSON.stringify(res.result, null, 2));
  })
  .catch(err => {
    console.warn(err)
  });
reclamation = resource_controller_service.run_reclamation_action(
    id=reclamation_id,
    action_name='reclaim'
).get_result()

print('\nrun_reclamation_action() response:\n',
      json.dumps(reclamation, indent=2))
runReclamationActionOptions := resourceControllerService.NewRunReclamationActionOptions(
  reclamationID,
  "reclaim",
)

reclamation, response, err := resourceControllerService.RunReclamationAction(runReclamationActionOptions)
if err != nil {
  panic(err)
}
b, _ := json.MarshalIndent(reclamation, "", "  ")
fmt.Printf("\nRunReclamationAction() response:\n%s\n", string(b))

CLI를 사용하여 리소스 복원

리소스는 일반적으로 삭제 후 3일 이내에 복원할 수 있습니다. 그러나 각 서비스마다 자체 보존 정책을 따르기 때문에 복원 기간은 서비스마다 다를 수 있습니다. 자세한 내용은 개별 서비스의 설명서를 참조하세요.

모든 리소스를 복원할 수 있는 것은 아닙니다. ibmcloud resource reclamations 명령을 실행하여 복원할 수 있는 리소스를 확인할 수 있습니다.

CLI를 사용하여 리소스를 복원하려면 다음 명령을 실행하십시오.

ibmcloud resource reclamation-restore ID [--comment COMMENT]

다음 명령 옵션을 입력하십시오.

  • ID: 리소스 교정의 ID(NAME과 배타적)입니다 이는 리소스 인스턴스 ID가 아닌 재확보 ID입니다  (필수)
  • --comment: 조치에 대한 주석입니다.

다음 예는 d9fendfwlw ID를 사용하여 리소스를 복원하는 방법을 보여줍니다.

ibmcloud resource reclamation-restore "d9fendfwlw"

자세한 정보는 ibmcloud resource reclamations 명령 참조를 참조하십시오.

API를 사용하여 리소스 복원

리소스는 일반적으로 삭제 후 3일 이내에 복원할 수 있습니다. 그러나 각 서비스마다 자체 보존 정책을 따르기 때문에 복원 기간은 서비스마다 다를 수 있습니다. 자세한 내용은 개별 서비스의 설명서를 참조하세요.

모든 리소스를 복원할 수 있는 것은 아닙니다. 복원할 수 있는 리소스를 확인하려면 모든 재확보 목록 가져오기를 수행하십시오.

API를 사용하여 리소스를 복원하려면 다음 예에 표시된 대로 IBM Cloud®리소스 제어기 API를 호출하십시오. 리소스를 복원하려면 restore을(를) 지정하십시오. id은(는) 리소스 인스턴스 ID가 아니라 재확보 ID입니다.

curl -X POST https://resource-controller.cloud.ibm.com/v1/reclamations/0114be9024c6eede47d08a85ac0c5c43/actions/restore -H 'Authorization: Bearer <IAM_TOKEN>' -H 'Content-Type: application/json' -d '{
    "request_by": "bar",
    "comment": "restore resource instance 614fc866-1d4f-4c9e-973e-637f1089a6a1"
  }'
RunReclamationActionOptions runReclamationActionOptions = new RunReclamationActionOptions.Builder()
  .id(reclamationId)
  .actionName("restore")
  .build();

Response<Reclamation> response = service.runReclamationAction(runReclamationActionOptions).execute();
Reclamation reclamation = response.getResult();

System.out.printf("runReclamationAction() response:\n%s\n", reclamation.toString());
const params = {
  id: reclamationId,
  actionName: 'restore',
};

resourceControllerService.runReclamationAction(params)
  .then(res => {
    console.log('runReclamationAction() response:\n' + JSON.stringify(res.result, null, 2));
  })
  .catch(err => {
    console.warn(err)
  });
reclamation = resource_controller_service.run_reclamation_action(
    id=reclamation_id,
    action_name='restore'
).get_result()

print('\nrun_reclamation_action() response:\n',
      json.dumps(reclamation, indent=2))
runReclamationActionOptions := resourceControllerService.NewRunReclamationActionOptions(
  reclamationID,
  "restore",
)

reclamation, response, err := resourceControllerService.RunReclamationAction(runReclamationActionOptions)
if err != nil {
  panic(err)
}
b, _ := json.MarshalIndent(reclamation, "", "  ")
fmt.Printf("\nRunReclamationAction() response:\n%s\n", string(b))