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

Change struct for inspectResources and registerCspResources with Err fix #1078

Merged
merged 3 commits into from
May 1, 2022

Conversation

seokho-son
Copy link
Member

1. 출력 구조 개선 (inspectResources)

idByTb, idBySp, idByCsp, refNameOrId 등으로 id 표기 명확화.

[요청]
POST ​/inspectResources
(Inspect Resources (vNet, securityGroup, sshKey, vm) registered in CB-Tumblebug, CB-Spider, CSP)

{
  "connectionName": "aws-ap-southeast-1",
  "resourceType": "vNet"
}

[출력] 등록된 리로스 아이디 리스트 (등록 실패한 리소스가 있는 경우, 해당 항목의 스트링에 실패 메시지가 포함)

{
  "connectionName": "aws-ap-southeast-1",
  "resourceType": "vNet",
  "systemMessage": "",
  "resourcesOnTumblebug": [
    {
      "idByTb": "aws-ap-southeast-1-shson",
      "idByCsp": "vpc-0a3291546ba7bc123",
      "nsId": "ns01",
      "objectKey": "/ns/ns01/resources/vNet/aws-ap-southeast-1-shson"
    }
  ],
  "resourcesOnSpider": [
    {
      "idBySp": "ns01-aws-ap-southeast-1-shson",
      "idByCsp": "vpc-0a3291546ba7bc123"
    }
  ],
  "resourcesOnCsp": [
    {
      "idByCsp": "vpc-0a3291546ba7bc123",
      "refNameOrId": "ns01-aws-ap-southeast-1-shson"
    },
    {
      "idByCsp": "vpc-0d66c5d1321877a3b",
      "refNameOrId": "aws-ap-southeast-1"
    },
    {
      "idByCsp": "vpc-0757c665436c8f276",
      "refNameOrId": "e1-aws-ap-c6au8hd434207t772j5g"
    },
...
    {
      "idByCsp": "vpc-0dbc2796370f73912",
      "refNameOrId": "e1-aws-ap-c5psb8543424jhjo396g"
    }
  ],
  "resourcesOnCspOnly": [
    {
      "idByCsp": "vpc-0d66c5d1321877a3b",
      "refNameOrId": "aws-ap-southeast-1"
    },
    {
      "idByCsp": "vpc-0757c665436c8f276",
      "refNameOrId": "e1-aws-ap-c6au8hd434207t772j5g"
    },
    {
      "idByCsp": "vpc-0c5ac338023c4108d",
      "refNameOrId": "ns01-aws--c6ff8o8vn0pcottrcho0"
    },
...
    {
      "idByCsp": "vpc-0adb418b3b621b080",
      "refNameOrId": "ns01-aws--c8t761g9ih7nmfkhocr0"
    },
    {
      "idByCsp": "vpc-0f5c4a299ef3e63ee",
      "refNameOrId": "aws-ap-southeast-1"
    },
    {
      "idByCsp": "vpc-0dbc2796370f73912",
      "refNameOrId": "e1-aws-ap-c5psb8543424jhjo396g"
    }
  ]
}

2. 출력 구조 개선 (registerCspResources)

출력값으로 등록된 리소스 아이디 리스트 및 등록 상태 정보 제공

[요청]
POST ​/registerCspResources
(Register CSP Native Resources (vNet, securityGroup, sshKey, vm) to CB-Tumblebug)

{
  "connectionName": "aws-ap-southeast-1",
  "mcisName": "mcis-csp-native",
  "nsId": "ns01"
}

[출력] 등록된 리소스 아이디 리스트 (등록 실패한 리소스가 있는 경우, 해당 항목의 스트링에 실패 메시지가 포함)

{
  "output": [
    "vNet: aws-ap-southeast-1-vpc-0d66c5d1321877a3b",
    "vNet: aws-ap-southeast-1-vpc-0757c665436c8f276",
    "vNet: aws-ap-southeast-1-vpc-0c5ac338023c4108d",
    "vNet: aws-ap-southeast-1-vpc-01898d54949ed51eb",
    "vNet: aws-ap-southeast-1-vpc-03e4610d8a4e151e7",
...
    "vNet: aws-ap-southeast-1-vpc-049e173cfe142322e",
    "vNet: aws-ap-southeast-1-vpc-031f3b02839cfdcaf",
    "vNet: aws-ap-southeast-1-vpc-e4f4d483",
    "vNet: aws-ap-southeast-1-vpc-0adb418b3b621b080",
    "vNet: aws-ap-southeast-1-vpc-0f5c4a299ef3e63ee",
    "vNet: aws-ap-southeast-1-vpc-0dbc2796370f73912",
    "securityGroup: aws-ap-southeast-1-sg-0058aa4f3572d7c7a",
    "securityGroup: aws-ap-southeast-1-sg-00a7a86a694c84f67",
    "securityGroup: aws-ap-southeast-1-sg-0133a3f9272db6ccf",
    "securityGroup: aws-ap-southeast-1-sg-0240cf26a5f9fdf4a",
    "securityGroup: aws-ap-southeast-1-sg-02a85f75655e96494",
    "securityGroup: aws-ap-southeast-1-sg-034618cf40232dee6",
    "securityGroup: aws-ap-southeast-1-sg-03d318e3ef10a9e68",
...
    "securityGroup: aws-ap-southeast-1-sg-0f5fb44e63da68a2f",
    "securityGroup: aws-ap-southeast-1-sg-0feffc5f6d0254c6e",
    "securityGroup: aws-ap-southeast-1-sg-b0c220cb",
    "sshKey: aws-ap-southeast-1-etcd-host-aws",
    "sshKey: aws-ap-southeast-1-k8s-test-kimy-aws",
    "sshKey: aws-ap-southeast-1-aws-ap-southeast-1",
    "sshKey: aws-ap-southeast-1-e1-aws-ap-c5psb8t43424jhjo3980",
...
    "sshKey: aws-ap-southeast-1-ns01-aws-ap-southeast-1-jhseo-c90o97t6qs8c0lm7ori0",
    "sshKey: aws-ap-southeast-1-ns01-aws-ap-southeast-1-yk0-c91rqbatiahu4g621ju0",
    "sshKey: aws-ap-southeast-1-ns01-aws--c9fsnmcdss6vnm1747s0",
    "sshKey: aws-ap-southeast-1-ns01-aws-ap-southeast-1-yk1net-c9kiqgkb8khu9chfogn0",
    "vm: aws-ap-southeast-1-i-014fa6ede6ada0b2c",
    "vm: aws-ap-southeast-1-i-0c2d783dd905dd372",
    "vm: aws-ap-southeast-1-i-06ea9ba67b3bcff93"
  ]
}

3. SG 전체 등록 오류 수정

SG 등록시, vNet ID가 필요함. 기존에는 임의의 vNet ID를 지정하였으나,

적어도 connection이 동일한 vNet의 ID를 지정해야 하는 것을 확인함.

임의의 vNet 지정시 동일한 등록할 SG와 동일한 connection을 가진 vNet을 지정하도록 코드 수정.

@seokho-son seokho-son requested a review from jihoon-seo as a code owner April 29, 2022 17:43
@seokho-son
Copy link
Member Author

/approve

@seokho-son seokho-son merged commit 4ead32a into cloud-barista:main May 1, 2022
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.

1 participant