Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tumblebug obj delete feature and update obj api #418

Merged
merged 2 commits into from
Mar 18, 2021

Conversation

seokho-son
Copy link
Member

  • Tumblebug Object의 강제 삭제 기능 제공.
  • Tumblebug Object 직접 조회 기능 API 업데이트.

기존 텀블벅은 텀블벅에 등록된 오브젝트(특히 문제가 있는 오브젝트)를 개발자가 확인하는 데 어려움이 있었음.

텀블벅의 오브젝트를 조회하고 데이터를 강제 삭제할 수 있는 기능 제공. (관리자 및 개발자를 위한 기능)

  1. get objects
  2. get object
  3. delete object
  4. delete objects

  1. GET http://localhost:1323/tumblebug/objects?key=/ns/ns-01/
    /ns/ns-01/ 가 포함된 모든 TB 오브젝트의 ID 리스트를 반환함.

  2. GET http://localhost:1323/tumblebug/object?key=/ns/ns-01/mcis/aws-ap-southeast-1-shson/vmgroup/aws-ap-southeast-1-shson
    /ns/ns-01/mcis/aws-ap-southeast-1-shson/vmgroup/aws-ap-southeast-1-shson 오브젝트의 값을 반환함.

  3. DELETE http://localhost:1323/tumblebug/object?key=/ns/ns-01/mcis/aws-ap-southeast-1-shson/vmgroup/aws-ap-southeast-1-shson
    /ns/ns-01/mcis/aws-ap-southeast-1-shson/vmgroup/aws-ap-southeast-1-shson 를 강제 삭제함.

  4. DELETE http://localhost:1323/tumblebug/objects?key=/ns/ns-01/mcis/
    /ns/ns-01/mcis/ 이하 모든 자식 오브젝트를 강제 삭제함.


테스트 스크립트

1) list-object.sh

son@son:~/go/src/github.com/cloud-barista/cb-tumblebug/test/official/sequentialFullTest$ ./list-object.sh /ns/ns-01/mcis/
####################################################################
## 0. Object: List
####################################################################
{
   "object" : [
      "/ns/ns-01/mcis/aws-ap-southeast-1-shson",
      "/ns/ns-01/mcis/aws-ap-southeast-1-shson/vm/aws-ap-southeast-1-shson-0",
      "/ns/ns-01/mcis/aws-ap-southeast-1-shson/vm/aws-ap-southeast-1-shson-1",
      "/ns/ns-01/mcis/aws-ap-southeast-1-shson/vm/aws-ap-southeast-1-shson-2",
      "/ns/ns-01/mcis/aws-ap-southeast-1-shson/vmgroup/aws-ap-southeast-1-shson"
   ]
}

son@son:~/go/src/github.com/cloud-barista/cb-tumblebug/test/official/sequentialFullTest$ ./list-object.sh /ns/ns-01/mcis/
####################################################################
## 0. Object: List
####################################################################
{
   "object" : null
}

2) get-object.sh

son@son:~/go/src/github.com/cloud-barista/cb-tumblebug/test/official/sequentialFullTest$ ./get-object.sh /ns/ns-01/mcis/aws-ap-southeast-1-shson/vmgroup/aws-ap-southeast-1-shson
####################################################################
## 0. Object: Get value
####################################################################
{
   "id" : "aws-ap-southeast-1-shson",
   "name" : "aws-ap-southeast-1-shson",
   "vmId" : [
      "aws-ap-southeast-1-shson-0",
      "aws-ap-southeast-1-shson-1",
      "aws-ap-southeast-1-shson-2"
   ],
   "vmGroupSize" : "3"
}

son@son:~/go/src/github.com/cloud-barista/cb-tumblebug/test/official/sequentialFullTest$ ./get-object.sh /ns/ns-01/mcis/aws-ap-southeast-1-shson/vmgroup/aws-ap-southeast-1-shson
####################################################################
## 0. Object: Get value
####################################################################
{
   "message" : "Failed to find /ns/ns-01/mcis/aws-ap-southeast-1-shson/vmgroup/aws-ap-southeast-1-shsonobject"
}

3) delete-object

son@son:~/go/src/github.com/cloud-barista/cb-tumblebug/test/official/sequentialFullTest$ ./delete-object.sh /ns/ns-01/resources/spec/aws-ap-southeast-1-x1e.xlarge
####################################################################
## 0. Object: Delete
####################################################################
{
   "message" : "The object has been deleted"
}

4) delete-objects

son@son:~/go/src/github.com/cloud-barista/cb-tumblebug/test/official/sequentialFullTest$ ./delete-objects-becareful.sh /ns/ns-01/resources/spec/aws-ap-southeast-1-x1e.
####################################################################
## 0. Object: Delete Child Objects
####################################################################
{
   "message" : "Objects have been deleted"
}
son@son:~/go/src/github.com/cloud-barista/cb-tumblebug/test/official/sequentialFullTest$ ./list-object.sh /ns/ns-01/resources/spec/aws-ap-southeast-1-x1e
####################################################################
## 0. Object: List
####################################################################
{
   "object" : null
}

@seokho-son
Copy link
Member Author

/assign @jihoon-seo

Copy link
Member

@jihoon-seo jihoon-seo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

편리한 기능일 것 같습니다!

src/api/rest/server/server.go Outdated Show resolved Hide resolved
Copy link
Member

@jihoon-seo jihoon-seo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!!

@seokho-son seokho-son merged commit 21a4126 into cloud-barista:master Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants