Skip to content

Added _ips#196

Merged
moul merged 1 commit into
scaleway:masterfrom
QuentinPerez:add_ips
Sep 29, 2015
Merged

Added _ips#196
moul merged 1 commit into
scaleway:masterfrom
QuentinPerez:add_ips

Conversation

@QuentinPerez
Copy link
Copy Markdown

#178

Display the IPs

./scw _ips | anonuuid
{
  "ips": [
    {
      "organization": "00000000-0000-1000-0000-000000000000",
      "reverse": "",
      "id": "11111111-1111-1111-1111-111111111111",
      "server": {
        "id": "22222222-2222-1222-2222-222222222222",
        "name": "buildwordpress"
      },
      "address": "212.47.239.7"
    }
  ]
}

Display an IP

./scw _ips 11111111-1111-1111-1111-111111111111 | anonuuid
{
  "ip": {
    "organization": "00000000-0000-1000-0000-000000000000",
    "reverse": "",
    "id": "11111111-1111-1111-1111-111111111111",
    "server": {
      "id": "22222222-2222-1222-2222-222222222222",
      "name": "buildwordpress"
    },
    "address": "212.47.239.7"
  }
}

New IP

./scw _ips -n
{
  "ip": {
    "organization": "00000000-0000-1000-0000-000000000000",
    "reverse": "",
    "id": "11111111-1111-1111-1111-111111111111",
    "server": {},
    "address": "212.47.249.205"
  }
}

./scw _ips | anonuuid
{
  "ips": [
    {
      "organization": "00000000-0000-1000-0000-000000000000",
      "reverse": "",
      "id": "11111111-1111-1111-1111-111111111111",
      "server": {},
      "address": "212.47.249.205"
    },
    {
      "organization": "00000000-0000-1000-0000-000000000000",
      "reverse": "",
      "id": "22222222-2222-1222-2222-222222222222",
      "server": {
        "id": "33333333-3333-1333-3333-333333333333",
        "name": "buildwordpress"
      },
      "address": "212.47.239.7"
    }
  ]
}

Delete an IP

./scw _ips -d 09591c34-8b87-4a99-a31b-d073020e1007
./scw _ips | anonuuid
{
  "ips": [
    {
      "organization": "00000000-0000-1000-0000-000000000000",
      "reverse": "",
      "id": "11111111-1111-1111-1111-111111111111",
      "server": {
        "id": "22222222-2222-1222-2222-222222222222",
        "name": "buildwordpress"
      },
      "address": "212.47.239.7"
    }
  ]
}

Attach an IP

./scw _ips -a 11111111-1111-1111-1111-111111111111 22222222-2222-1222-2222-222222222222
./scw _ips | anonuuid
{
  "ips": [
    {
      "organization": "00000000-0000-1000-0000-000000000000",
      "reverse": "",
      "id": "11111111-1111-1111-1111-111111111111",
      "server": {
        "id": "22222222-2222-1222-2222-222222222222",
        "name": "scw-e34a94"
      },
      "address": "212.47.249.205"
    },
    {
      "organization": "00000000-0000-1000-0000-000000000000",
      "reverse": "",
      "id": "33333333-3333-1333-3333-333333333333",
      "server": {
        "id": "44444444-4444-1444-4444-444444444444",
        "name": "buildwordpress"
      },
      "address": "212.47.239.7"
    }
  ]
}

Comment thread pkg/api/api.go
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

exported type ScalewayGetIPS should have comment or be unexported

@moul
Copy link
Copy Markdown

moul commented Sep 29, 2015

LGTM for "get ips", now we need to implement some actions like attach ip to a server which is what is blocking @arianvp

@moul
Copy link
Copy Markdown

moul commented Sep 29, 2015

About the "attach ip to server", you can do it from the scw _patch server:... if you want, we can keep scw _ips just for listing if you prefer

Comment thread pkg/api/api.go
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

exported type ScalewayGetIP should have comment or be unexported

@moul
Copy link
Copy Markdown

moul commented Sep 29, 2015

As the method is prefixed by _, I'm okay to merge it soon and open a new ticket to improve globally _ips support

But you need to move the API calls in the pkg/api, this is mandatory as it is exactly what @arianvp is looking for

Comment thread pkg/api/api.go Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Be uniform, use always ipID

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oups mistake idIP -> ipID 😄

@moul
Copy link
Copy Markdown

moul commented Sep 29, 2015

LGTM

moul added a commit that referenced this pull request Sep 29, 2015
@moul moul merged commit c45e35b into scaleway:master Sep 29, 2015
@moul moul removed the in progress label Sep 29, 2015
clement-gilbert pushed a commit to clement-gilbert/scaleway-cli that referenced this pull request Mar 3, 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.

3 participants