Skip to content

Commit

Permalink
Allow to inspect snapshots, fixes #510
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Castets committed Jun 28, 2018
1 parent 9c04e7a commit d55e4b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,8 @@ $ scw inspect myserver | jq '.[0].public_ip.address'

### v1.16+dev (unreleased)

This is the current development version. Update below with your changes. Remove
this line when releasing the package.
* Fix: it is now possible to `scw inspect` snapshots
* Fix: add region details in cache for snapshots, images, bootscripts and volumes.

View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.16...master)

Expand Down
16 changes: 8 additions & 8 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ func (s *ScalewayAPI) PostSnapshot(volumeID string, name string) (string, error)
return "", err
}
// FIXME arch, owner, title
s.Cache.InsertSnapshot(snapshot.Snapshot.Identifier, "", "", snapshot.Snapshot.Organization, snapshot.Snapshot.Name)
s.Cache.InsertSnapshot(snapshot.Snapshot.Identifier, s.Region, "", snapshot.Snapshot.Organization, snapshot.Snapshot.Name)
return snapshot.Snapshot.Identifier, nil
}

Expand Down Expand Up @@ -1414,7 +1414,7 @@ func (s *ScalewayAPI) PostImage(volumeID string, name string, bootscript string,
return "", err
}
// FIXME region, arch, owner, title
s.Cache.InsertImage(image.Image.Identifier, "", image.Image.Arch, image.Image.Organization, image.Image.Name, "")
s.Cache.InsertImage(image.Image.Identifier, s.Region, image.Image.Arch, image.Image.Organization, image.Image.Name, "")
return image.Image.Identifier, nil
}

Expand Down Expand Up @@ -1690,7 +1690,7 @@ func (s *ScalewayAPI) GetSnapshots() (*[]ScalewaySnapshot, error) {
}
for _, snapshot := range snapshots.Snapshots {
// FIXME region, arch, owner, title
s.Cache.InsertSnapshot(snapshot.Identifier, "", "", snapshot.Organization, snapshot.Name)
s.Cache.InsertSnapshot(snapshot.Identifier, s.Region, "", snapshot.Organization, snapshot.Name)
}
return &snapshots.Snapshots, nil
}
Expand All @@ -1713,7 +1713,7 @@ func (s *ScalewayAPI) GetSnapshot(snapshotID string) (*ScalewaySnapshot, error)
return nil, err
}
// FIXME region, arch, owner, title
s.Cache.InsertSnapshot(oneSnapshot.Snapshot.Identifier, "", "", oneSnapshot.Snapshot.Organization, oneSnapshot.Snapshot.Name)
s.Cache.InsertSnapshot(oneSnapshot.Snapshot.Identifier, s.Region, "", oneSnapshot.Snapshot.Organization, oneSnapshot.Snapshot.Name)
return &oneSnapshot.Snapshot, nil
}

Expand All @@ -1740,7 +1740,7 @@ func (s *ScalewayAPI) GetVolumes() (*[]ScalewayVolume, error) {
}
for _, volume := range volumes.Volumes {
// FIXME region, arch, owner, title
s.Cache.InsertVolume(volume.Identifier, "", "", volume.Organization, volume.Name)
s.Cache.InsertVolume(volume.Identifier, s.Region, "", volume.Organization, volume.Name)
}
return &volumes.Volumes, nil
}
Expand All @@ -1763,7 +1763,7 @@ func (s *ScalewayAPI) GetVolume(volumeID string) (*ScalewayVolume, error) {
return nil, err
}
// FIXME region, arch, owner, title
s.Cache.InsertVolume(oneVolume.Volume.Identifier, "", "", oneVolume.Volume.Organization, oneVolume.Volume.Name)
s.Cache.InsertVolume(oneVolume.Volume.Identifier, s.Region, "", oneVolume.Volume.Organization, oneVolume.Volume.Name)
return &oneVolume.Volume, nil
}

Expand All @@ -1789,7 +1789,7 @@ func (s *ScalewayAPI) GetBootscripts() (*[]ScalewayBootscript, error) {
}
for _, bootscript := range bootscripts.Bootscripts {
// FIXME region, arch, owner, title
s.Cache.InsertBootscript(bootscript.Identifier, "", bootscript.Arch, bootscript.Organization, bootscript.Title)
s.Cache.InsertBootscript(bootscript.Identifier, s.Region, bootscript.Arch, bootscript.Organization, bootscript.Title)
}
return &bootscripts.Bootscripts, nil
}
Expand All @@ -1812,7 +1812,7 @@ func (s *ScalewayAPI) GetBootscript(bootscriptID string) (*ScalewayBootscript, e
return nil, err
}
// FIXME region, arch, owner, title
s.Cache.InsertBootscript(oneBootscript.Bootscript.Identifier, "", oneBootscript.Bootscript.Arch, oneBootscript.Bootscript.Organization, oneBootscript.Bootscript.Title)
s.Cache.InsertBootscript(oneBootscript.Bootscript.Identifier, s.Region, oneBootscript.Bootscript.Arch, oneBootscript.Bootscript.Organization, oneBootscript.Bootscript.Title)
return &oneBootscript.Bootscript, nil
}

Expand Down

0 comments on commit d55e4b7

Please sign in to comment.