Skip to content

Commit

Permalink
Merge pull request #591 from inno-cloudbarista/cloudit/resourceclean
Browse files Browse the repository at this point in the history
[Cloudit] VM 생성 실패시 자원 반환 및 VM VPC-subnet 체크, API Client 함수 제거 #589
  • Loading branch information
powerkimhub authored Mar 30, 2022
2 parents 6f75e3e + 0a8d11a commit a35009e
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,6 @@ func List(restClient *client.RestClient, requestOpts *client.RequestOpts) (*[]Su
return &subnet, nil
}

func ListCreatableSubnet(restClient *client.RestClient, requestOpts *client.RequestOpts) (*[]SubnetInfo, error) {
requestURL := restClient.CreateRequestBaseURL(client.DNA, "subnets", "creatable")
cblogger.Info(requestURL)

var result client.Result
if _, result.Err = restClient.Get(requestURL, &result.Body, requestOpts); result.Err != nil {
return nil, result.Err
}

var subnet []SubnetInfo
if err := result.ExtractInto(&subnet); err != nil {
return nil, err
}
return &subnet, nil
}

func Get(restClient *client.RestClient, subnetId string, requestOpts *client.RequestOpts) (*SubnetInfo, error) {
requestURL := restClient.CreateRequestBaseURL(client.DNA, subnetId, "detail")
cblogger.Info(requestURL)

var result client.Result
if _, result.Err = restClient.Get(requestURL, &result.Body, requestOpts); result.Err != nil {
return nil, result.Err
}

var subnet SubnetInfo
if err := result.ExtractInto(&subnet); err != nil {
return nil, err
}
return &subnet, nil
}

func Create(restClient *client.RestClient, requestOpts *client.RequestOpts) (*SubnetInfo, error) {
requestURL := restClient.CreateRequestBaseURL(client.DNA, "subnets")
cblogger.Info(requestURL)
Expand Down
Loading

0 comments on commit a35009e

Please sign in to comment.