lxd/maas/controller.go
func (c *Controller) RenameContainer(name string, newName string) error {
	device, err := c.getDevice(name)
	if err != nil {
		return err
	}

	// FIXME: We should convince the Juju folks to implement an Update() method on Device
	uri, err := url.Parse(fmt.Sprintf("%s/devices/%s/", c.url, device.SystemID()))
	if err != nil {
		return err
	}

	values := url.Values{}
	values.Set("hostname", newName)

	_, err = c.srvRaw.Put(uri, values)
	if err != nil {
		return err
	}

	return nil
}
func (c *Controller) RenameContainer(name string, newName string) error {
	device, err := c.getDevice(name)
	if err != nil {
		return err
	}

	// FIXME: We should convince the Juju folks to implement an Update() method on Device
	uri, err := url.Parse(fmt.Sprintf("%s/devices/%s/", c.url, device.SystemID()))
	if err != nil {
		return err
	}

	values := url.Values{}
	values.Set("hostname", newName)

	_, err = c.srvRaw.Put(uri, values)
	if err != nil {
		return err
	}

	return nil
}
func ( c * Controller ) RenameContainer ( name string , newName string ) error { device , err := c . getDevice ( name ) if err != nil { return err } // FIXME: We should convince the Juju folks to implement an Update() method on Device uri , err := url . Parse ( fmt . Sprintf ( " " , c . url , device . SystemID ( ) ) ) if err != nil { return err } values := url . Values { } values . Set ( " " , newName ) _ , err = c . srvRaw . Put ( uri , values ) if err != nil { return err } return nil }
// RenameContainer renames the MAAS device for the container without releasing any allocation
RenameContainer renames the MAAS device for the container without releasing any allocation