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

Added _ips #196

Merged
merged 1 commit into from
Sep 29, 2015
Merged

Added _ips #196

merged 1 commit into from
Sep 29, 2015

Conversation

QuentinPerez
Copy link
Contributor

#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"
    }
  ]
}

Address string `json:"address"`
}

type ScalewayGetIPS struct {

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
Contributor

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
Contributor

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

IPS []ScalewayIPDefinition `json:"ips"`
}

type ScalewayGetIP struct {

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
Contributor

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

}

// AttachIP attachs an IP to a server
func (s *ScalewayAPI) AttachIP(idIP, serverID string) error {
Copy link
Contributor

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
Contributor 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
Contributor

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