예제 #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,
		})
	}
}
예제 #2
0
파일: update.go 프로젝트: 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)
}
예제 #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)
}