@@ -533,6 +533,7 @@ type ScalewayServer struct {
533533 Hypervisor string `json:"hypervisor_id,omitempty"`
534534 Blade string `json:"blade_id,omitempty"`
535535 Node string `json:"node_id,omitempty"`
536+ ZoneID string `json:"zone_id,omitempty"`
536537 } `json:"location,omitempty"`
537538
538539 IPV6 * ScalewayIPV6Definition `json:"ipv6,omitempty"`
@@ -1128,10 +1129,10 @@ func (s *ScalewayAPI) GetServers(all bool, limit int) (*[]ScalewayServer, error)
11281129 return nil , err
11291130 }
11301131 for i , server := range servers .Servers {
1131- // FIXME region, arch, owner, title
1132+ // FIXME arch, owner, title
11321133 servers .Servers [i ].DNSPublic = server .Identifier + URLPublicDNS
11331134 servers .Servers [i ].DNSPrivate = server .Identifier + URLPrivateDNS
1134- s .Cache .InsertServer (server .Identifier , "fr-1" , server .Arch , server .Organization , server .Name )
1135+ s .Cache .InsertServer (server .Identifier , server . Location . ZoneID , server .Arch , server .Organization , server .Name )
11351136 }
11361137 // FIXME: when API limit is ready, remove the following code
11371138 if limit > 0 && limit < len (servers .Servers ) {
@@ -1177,10 +1178,10 @@ func (s *ScalewayAPI) GetServer(serverID string) (*ScalewayServer, error) {
11771178 if err = json .Unmarshal (body , & oneServer ); err != nil {
11781179 return nil , err
11791180 }
1180- // FIXME region, arch, owner, title
1181+ // FIXME arch, owner, title
11811182 oneServer .Server .DNSPublic = oneServer .Server .Identifier + URLPublicDNS
11821183 oneServer .Server .DNSPrivate = oneServer .Server .Identifier + URLPrivateDNS
1183- s .Cache .InsertServer (oneServer .Server .Identifier , "fr-1" , oneServer .Server .Arch , oneServer .Server .Organization , oneServer .Server .Name )
1184+ s .Cache .InsertServer (oneServer .Server .Identifier , oneServer . Server . Location . ZoneID , oneServer .Server .Arch , oneServer .Server .Organization , oneServer .Server .Name )
11841185 return & oneServer .Server , nil
11851186}
11861187
@@ -1239,8 +1240,8 @@ func (s *ScalewayAPI) PostServer(definition ScalewayServerDefinition) (string, e
12391240 if err = json .Unmarshal (body , & server ); err != nil {
12401241 return "" , err
12411242 }
1242- // FIXME region, arch, owner, title
1243- s .Cache .InsertServer (server .Server .Identifier , "fr-1" , server .Server .Arch , server .Server .Organization , server .Server .Name )
1243+ // FIXME arch, owner, title
1244+ s .Cache .InsertServer (server .Server .Identifier , server . Server . Location . ZoneID , server .Server .Arch , server .Server .Organization , server .Server .Name )
12441245 return server .Server .Identifier , nil
12451246}
12461247
@@ -1299,8 +1300,8 @@ func (s *ScalewayAPI) PostSnapshot(volumeID string, name string) (string, error)
12991300 if err = json .Unmarshal (body , & snapshot ); err != nil {
13001301 return "" , err
13011302 }
1302- // FIXME region, arch, owner, title
1303- s .Cache .InsertSnapshot (snapshot .Snapshot .Identifier , "fr-1 " , "" , snapshot .Snapshot .Organization , snapshot .Snapshot .Name )
1303+ // FIXME arch, owner, title
1304+ s .Cache .InsertSnapshot (snapshot .Snapshot .Identifier , "" , "" , snapshot .Snapshot .Organization , snapshot .Snapshot .Name )
13041305 return snapshot .Snapshot .Identifier , nil
13051306}
13061307
@@ -1334,7 +1335,7 @@ func (s *ScalewayAPI) PostImage(volumeID string, name string, bootscript string,
13341335 return "" , err
13351336 }
13361337 // FIXME region, arch, owner, title
1337- s .Cache .InsertImage (image .Image .Identifier , "fr-1 " , image .Image .Arch , image .Image .Organization , image .Image .Name , "" )
1338+ s .Cache .InsertImage (image .Image .Identifier , "" , image .Image .Arch , image .Image .Organization , image .Image .Name , "" )
13381339 return image .Image .Identifier , nil
13391340}
13401341
@@ -1491,7 +1492,7 @@ func (s *ScalewayAPI) GetImages() (*[]MarketImage, error) {
14911492 return nil , err
14921493 }
14931494 for _ , orgaImage := range OrgaImages .Images {
1494- s .Cache .InsertImage (orgaImage .Identifier , "fr-1 " , orgaImage .Arch , orgaImage .Organization , orgaImage .Name , "" )
1495+ s .Cache .InsertImage (orgaImage .Identifier , "" , orgaImage .Arch , orgaImage .Organization , orgaImage .Name , "" )
14951496 images .Images = append (images .Images , MarketImage {
14961497 Categories : []string {"MyImages" },
14971498 CreationDate : orgaImage .CreationDate ,
@@ -1510,7 +1511,7 @@ func (s *ScalewayAPI) GetImages() (*[]MarketImage, error) {
15101511 {
15111512 Arch : orgaImage .Arch ,
15121513 ID : orgaImage .Identifier ,
1513- Zone : "fr-1 " ,
1514+ Zone : "" ,
15141515 },
15151516 },
15161517 },
@@ -1542,7 +1543,7 @@ func (s *ScalewayAPI) GetImage(imageID string) (*ScalewayImage, error) {
15421543 return nil , err
15431544 }
15441545 // FIXME region, arch, owner, title
1545- s .Cache .InsertImage (oneImage .Image .Identifier , "fr-1 " , oneImage .Image .Arch , oneImage .Image .Organization , oneImage .Image .Name , "" )
1546+ s .Cache .InsertImage (oneImage .Image .Identifier , "" , oneImage .Image .Arch , oneImage .Image .Organization , oneImage .Image .Name , "" )
15461547 return & oneImage .Image , nil
15471548}
15481549
@@ -1621,7 +1622,7 @@ func (s *ScalewayAPI) GetSnapshots() (*[]ScalewaySnapshot, error) {
16211622 }
16221623 for _ , snapshot := range snapshots .Snapshots {
16231624 // FIXME region, arch, owner, title
1624- s .Cache .InsertSnapshot (snapshot .Identifier , "fr-1 " , "" , snapshot .Organization , snapshot .Name )
1625+ s .Cache .InsertSnapshot (snapshot .Identifier , "" , "" , snapshot .Organization , snapshot .Name )
16251626 }
16261627 return & snapshots .Snapshots , nil
16271628}
@@ -1646,7 +1647,7 @@ func (s *ScalewayAPI) GetSnapshot(snapshotID string) (*ScalewaySnapshot, error)
16461647 return nil , err
16471648 }
16481649 // FIXME region, arch, owner, title
1649- s .Cache .InsertSnapshot (oneSnapshot .Snapshot .Identifier , "fr-1 " , "" , oneSnapshot .Snapshot .Organization , oneSnapshot .Snapshot .Name )
1650+ s .Cache .InsertSnapshot (oneSnapshot .Snapshot .Identifier , "" , "" , oneSnapshot .Snapshot .Organization , oneSnapshot .Snapshot .Name )
16501651 return & oneSnapshot .Snapshot , nil
16511652}
16521653
@@ -1675,7 +1676,7 @@ func (s *ScalewayAPI) GetVolumes() (*[]ScalewayVolume, error) {
16751676 }
16761677 for _ , volume := range volumes .Volumes {
16771678 // FIXME region, arch, owner, title
1678- s .Cache .InsertVolume (volume .Identifier , "fr-1 " , "" , volume .Organization , volume .Name )
1679+ s .Cache .InsertVolume (volume .Identifier , "" , "" , volume .Organization , volume .Name )
16791680 }
16801681 return & volumes .Volumes , nil
16811682}
@@ -1700,7 +1701,7 @@ func (s *ScalewayAPI) GetVolume(volumeID string) (*ScalewayVolume, error) {
17001701 return nil , err
17011702 }
17021703 // FIXME region, arch, owner, title
1703- s .Cache .InsertVolume (oneVolume .Volume .Identifier , "fr-1 " , "" , oneVolume .Volume .Organization , oneVolume .Volume .Name )
1704+ s .Cache .InsertVolume (oneVolume .Volume .Identifier , "" , "" , oneVolume .Volume .Organization , oneVolume .Volume .Name )
17041705 return & oneVolume .Volume , nil
17051706}
17061707
@@ -1728,7 +1729,7 @@ func (s *ScalewayAPI) GetBootscripts() (*[]ScalewayBootscript, error) {
17281729 }
17291730 for _ , bootscript := range bootscripts .Bootscripts {
17301731 // FIXME region, arch, owner, title
1731- s .Cache .InsertBootscript (bootscript .Identifier , "fr-1 " , bootscript .Arch , bootscript .Organization , bootscript .Title )
1732+ s .Cache .InsertBootscript (bootscript .Identifier , "" , bootscript .Arch , bootscript .Organization , bootscript .Title )
17321733 }
17331734 return & bootscripts .Bootscripts , nil
17341735}
@@ -1753,7 +1754,7 @@ func (s *ScalewayAPI) GetBootscript(bootscriptID string) (*ScalewayBootscript, e
17531754 return nil , err
17541755 }
17551756 // FIXME region, arch, owner, title
1756- s .Cache .InsertBootscript (oneBootscript .Bootscript .Identifier , "fr-1 " , oneBootscript .Bootscript .Arch , oneBootscript .Bootscript .Organization , oneBootscript .Bootscript .Title )
1757+ s .Cache .InsertBootscript (oneBootscript .Bootscript .Identifier , "" , oneBootscript .Bootscript .Arch , oneBootscript .Bootscript .Organization , oneBootscript .Bootscript .Title )
17571758 return & oneBootscript .Bootscript , nil
17581759}
17591760
@@ -2153,7 +2154,7 @@ func (s *ScalewayAPI) GetImageID(needle, arch string) (*ScalewayImageIdentifier,
21532154 Identifier : images [0 ].Identifier ,
21542155 Arch : images [0 ].Arch ,
21552156 // FIXME region, owner hardcoded
2156- Region : "fr-1 " ,
2157+ Region : "" ,
21572158 Owner : "" ,
21582159 }, nil
21592160 }
0 commit comments