Example #1
0
func (sdk *RackspaceSDK) RenameInstanceByIp(name, ip string) {
	instance, exist := sdk.ListAllRunningInstance()[ip]
	if exist {
		servers.Update(sdk.p, instance.Id, OpenStackServers.UpdateOpts{
			Name: name,
		})
	}
}
Example #2
0
File: update.go Project: flazz/rack
func (command *commandUpdate) Execute(resource *handler.Resource) {
	params := resource.Params.(*paramsUpdate)
	server, err := servers.Update(command.Ctx.ServiceClient, params.serverID, params.opts).Extract()
	if err != nil {
		resource.Err = err
		return
	}
	resource.Result = serverSingle(server)
}
Example #3
0
func updateServer(t *testing.T, client *gophercloud.ServiceClient, server *os.Server) {
	t.Logf("> servers.Get")

	opts := os.UpdateOpts{
		Name: "updated-server",
	}
	updatedServer, err := servers.Update(client, server.ID, opts).Extract()
	th.AssertNoErr(t, err)
	th.AssertEquals(t, "updated-server", updatedServer.Name)
	logServer(t, updatedServer, -1)
}