juju: github.com/juju/juju/api/migrationtarget Index | Files

package migrationtarget

import "github.com/juju/juju/api/migrationtarget"

Package migrationtarget defines the client side API facade for use by the migration master worker when communicating with the target controller.


Package Files

client.go doc.go

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client is the client-side API for the MigrationTarget facade. It is used by the migrationmaster worker when talking to the target controller during a migration.

func NewClient Uses

func NewClient(caller base.APICaller) *Client

NewClient returns a new Client based on an existing API connection.

func (*Client) Abort Uses

func (c *Client) Abort(modelUUID string) error

Abort removes all data relating to a previously imported model.

func (*Client) Activate Uses

func (c *Client) Activate(modelUUID string) error

Activate marks a migrated model as being ready to use.

func (*Client) AdoptResources Uses

func (c *Client) AdoptResources(modelUUID string) error

AdoptResources asks the cloud provider to update the controller tags for a model's resources. This prevents the resources from being destroyed if the source controller is destroyed after the model is migrated away.

func (*Client) CACert Uses

func (c *Client) CACert() (string, error)

CACert returns the CA certificate associated with the connection.

func (*Client) CheckMachines Uses

func (c *Client) CheckMachines(modelUUID string) ([]error, error)

CheckMachines compares the machines in state with the ones reported by the provider and reports any discrepancies.

func (*Client) Import Uses

func (c *Client) Import(bytes []byte) error

Import takes a serialized model and imports it into the target controller.

func (*Client) LatestLogTime Uses

func (c *Client) LatestLogTime(modelUUID string) (time.Time, error)

LatestLogTime asks the target controller for the time of the latest log record it has seen. This can be used to make the log transfer restartable.

func (*Client) OpenLogTransferStream Uses

func (c *Client) OpenLogTransferStream(modelUUID string) (base.Stream, error)

OpenLogTransferStream connects to the migration logtransfer endpoint on the target controller and returns a stream that JSON logs records can be fed into. The objects written should be params.LogRecords.

func (*Client) Prechecks Uses

func (c *Client) Prechecks(model coremigration.ModelInfo) error

func (*Client) SetPlaceholderResource Uses

func (c *Client) SetPlaceholderResource(modelUUID string, res resource.Resource) error

SetPlaceholderResource sets the metadata for a placeholder resource.

func (*Client) SetUnitResource Uses

func (c *Client) SetUnitResource(modelUUID, unit string, res resource.Resource) error

SetUnitResource sets the metadata for a particular unit resource.

func (*Client) UploadCharm Uses

func (c *Client) UploadCharm(modelUUID string, curl *charm.URL, content io.ReadSeeker) (*charm.URL, error)

UploadCharm sends the content to the API server using an HTTP post in order to add the charm binary to the model specified.

func (*Client) UploadResource Uses

func (c *Client) UploadResource(modelUUID string, res resource.Resource, r io.ReadSeeker) error

UploadResource uploads a resource to the migration endpoint.

func (*Client) UploadTools Uses

func (c *Client) UploadTools(modelUUID string, r io.ReadSeeker, vers version.Binary, additionalSeries ...string) (tools.List, error)

UploadTools uploads tools at the specified location to the API server over HTTPS for the specified model.

Package migrationtarget imports 18 packages (graph) and is imported by 39 packages. Updated 2020-05-10. Refresh now. Tools for package owners.