Documentation ¶
Index ¶
- Variables
- func GlobalGet(ctx *cli.Context)
- func GlobalUpload(ctx *cli.Context)
- func PolicyDelete(ctx *cli.Context)
- func PolicyGet(ctx *cli.Context)
- func PolicyGetRevision(ctx *cli.Context)
- func PolicyList(ctx *cli.Context)
- func PolicyListRevisions(ctx *cli.Context)
- func PolicyUpload(ctx *cli.Context)
- func PolicyWatch(ctx *cli.Context)
- func UseExec(ctx *cli.Context)
- func UseGet(ctx *cli.Context)
- func UseList(ctx *cli.Context)
- func UseTheForce(ctx *cli.Context)
- func VolumeCreate(ctx *cli.Context)
- func VolumeForceRemove(ctx *cli.Context)
- func VolumeGet(ctx *cli.Context)
- func VolumeList(ctx *cli.Context)
- func VolumeListAll(ctx *cli.Context)
- func VolumeRemove(ctx *cli.Context)
- func VolumeRuntimeGet(ctx *cli.Context)
- func VolumeRuntimeUpload(ctx *cli.Context)
- func VolumeSnapshotCopy(ctx *cli.Context)
- func VolumeSnapshotList(ctx *cli.Context)
- func VolumeSnapshotTake(ctx *cli.Context)
Constants ¶
This section is empty.
Variables ¶
var Commands = []cli.Command{ { Name: "global", Usage: "Manage Global Configuration", Subcommands: []cli.Command{ { Name: "upload", ArgsUsage: "accepts configuration from stdin", Description: "Uploads a the global configuration to etcd. Accepts JSON.", Usage: "Upload a policy to etcd", Action: GlobalUpload, }, { Name: "get", ArgsUsage: "[policy name]", Usage: "Obtain the global configuration", Description: "Gets the global configuration from etcd", Action: GlobalGet, }, }, }, { Name: "policy", Usage: "Manage Policies", Subcommands: []cli.Command{ { Name: "upload", ArgsUsage: "[policy name]. accepts from stdin", Description: "Uploads a policy to etcd. Accepts JSON. Requires direct, unauthenticated access to etcd.", Usage: "Upload a policy to etcd", Action: PolicyUpload, }, { Name: "delete", ArgsUsage: "[policy name]", Description: "Permanently removes a policy from etcd. Volumes that belong to the policy are unaffected.", Usage: "Delete a policy", Action: PolicyDelete, }, { Name: "get", ArgsUsage: "[policy name]", Usage: "Obtain the policy", Description: "Gets the policy for a policy from etcd.", Action: PolicyGet, }, { Name: "list", ArgsUsage: "", Description: "Reads policies and generates a newline-delimited list", Usage: "List all policies", Action: PolicyList, }, { Name: "history", Description: "See historical policy revisions", Usage: "See historical policy revisions", Subcommands: []cli.Command{ { Name: "get", ArgsUsage: "[policy name] [revision]", Description: "Retrieve a single revision of a policy", Usage: "Retrieve a single revision of a policy", Action: PolicyGetRevision, }, { Name: "list", ArgsUsage: "[policy name]", Description: "List all revisions of a policy", Usage: "List all revisions of a policy", Action: PolicyListRevisions, }, }, }, { Name: "watch", ArgsUsage: "", Description: "Watch for policy changes", Usage: "Watch for policy changes", Action: PolicyWatch, }, }, }, { Name: "volume", Usage: "Manage Volumes", Subcommands: []cli.Command{ { Name: "create", Flags: []cli.Flag{cli.StringSliceFlag{ Name: "opt", Usage: "Provide key=value options to create the volume", }}, ArgsUsage: "[policy name]/[volume name]", Description: "This creates a logical volume. Calls out to the apiserver and sets the policy based on the policy name provided.", Usage: "Create a volume for a given policy", Action: VolumeCreate, }, { Name: "get", ArgsUsage: "[policy name]/[volume name]", Usage: "Get JSON configuration for a volume", Description: "Obtain the JSON configuration for the volume", Action: VolumeGet, }, { Name: "list", ArgsUsage: "[policy name]", Description: "Given a policy name, produces a newline-delimited list of volumes.", Usage: "List all volumes for a given policy", Action: VolumeList, }, { Name: "list-all", ArgsUsage: "", Description: "Produces a newline-delimited list of policy/volume combinations.", Usage: "List all volumes across policies", Action: VolumeListAll, }, { Name: "force-remove", ArgsUsage: "[policy name]/[volume name]", Description: "Forcefully removes a volume without deleting or unmounting the underlying image", Usage: "Forcefully remove a volume without removing the underlying image", Action: VolumeForceRemove, }, { Name: "remove", Flags: []cli.Flag{ cli.StringFlag{ Name: "timeout, t", Usage: "Retry to remove the volume until the timeout is reached", }, cli.BoolFlag{ Name: "force, f", Usage: "Remove the volume forcefully if possible", }, }, ArgsUsage: "[policy name]/[volume name]", Description: "Remove the volume for a policy, deleting its contents.", Usage: "Remove a volume and its contents", Action: VolumeRemove, }, { Name: "snapshot", Description: "Snapshot management tools", Usage: "Snapshot management tools", Subcommands: []cli.Command{ { Name: "take", ArgsUsage: "[policy name]/[volume name]", Description: "Take a snapshot for a volume now", Usage: "Take a snapshot for a volume now", Action: VolumeSnapshotTake, }, { Name: "list", ArgsUsage: "[policy name]/[volume name]", Description: "List snapshots", Usage: "List snapshots", Action: VolumeSnapshotList, }, { Name: "copy", ArgsUsage: "[policy name]/[volume name] [snapshot name] [new volume name]", Description: "Copies a volume with a given snapshot name to the new volume name. The policy will remain the same, as well as the volume parameters.", Usage: "Copy a volume snapshot to a new volume", Action: VolumeSnapshotCopy, }, }, }, { Name: "runtime", Description: "Runtime configuration management", Usage: "Runtime configuration management", Subcommands: []cli.Command{ { Name: "get", ArgsUsage: "[policy name]/[volume name]", Description: "Get runtime configuration", Usage: "Get runtime configuration", Action: VolumeRuntimeGet, }, { Name: "upload", ArgsUsage: "[policy name]/[volume name]", Description: "Upload runtime configuration", Usage: "Upload runtime configuration", Action: VolumeRuntimeUpload, }, }, }, }, }, { Name: "use", Usage: "Manage Uses (hosts consuming resources)", Subcommands: []cli.Command{ { Name: "list", Usage: "List uses", Description: "List the uses the apiserver knows about, in newline-delimited form.", ArgsUsage: "", Flags: []cli.Flag{ cli.BoolFlag{ Name: "snapshots", Usage: "List snapshots instead of mounts", }, }, Action: UseList, }, { Name: "get", Usage: "Get use info", Description: "Obtains the information on a specified use. Requires that you know the policy and image name.", ArgsUsage: "[policy name]/[volume name]", Flags: []cli.Flag{ cli.BoolFlag{ Name: "snapshot", Usage: "Get the snapshot use instead of a mount", }, }, Action: UseGet, }, { Name: "force-remove", ArgsUsage: "[policy name]/[volume name]", Usage: "Forcefully remove use information", Description: "Force-remove a use. Use this to correct unuseing errors or failing hosts if necessary. Requires that you know the policy and image name.", Action: UseTheForce, }, { Name: "exec", ArgsUsage: "[policy name]/[volume name] -- [command] ...", Usage: "Execute a command when use locks free.", Description: "When both snapshot and mount locks are freed, take the locks and execute the command.", Action: UseExec, }, }, }, }
Commands is the data structure which describes the command hierarchy for volcli.
var GlobalFlags = []cli.Flag{ cli.StringFlag{ Name: "prefix", Usage: "prefix key used in etcd for namespacing", Value: "/volplugin", }, cli.StringSliceFlag{ Name: "etcd", Usage: "URL for etcd", Value: &cli.StringSlice{"http://localhost:2379"}, }, cli.StringFlag{ Name: "apiserver", Usage: "address of apiserver process", Value: "127.0.0.1:9005", }, }
GlobalFlags are required global flags for the operation of volcli.
Functions ¶
func GlobalUpload ¶
GlobalUpload uploads the global configuration
func PolicyDelete ¶
PolicyDelete removes a policy supplied as an argument.
func PolicyGet ¶
PolicyGet retrieves policy configuration, the name of which is supplied as an argument.
func PolicyGetRevision ¶ added in v0.3.0
PolicyGetRevision retrieves a single revision from a policy's history.
func PolicyListRevisions ¶ added in v0.3.0
PolicyListRevisions retrieves all the revisions for a given policy.
func PolicyUpload ¶
PolicyUpload uploads a Policy intent from stdin.
func PolicyWatch ¶ added in v0.3.0
PolicyWatch watches etcd for policy changes and prints the name and revision when a policy is uploaded.
func UseExec ¶
UseExec acquires a lock (waiting if necessary) and executes a command when it takes it.
func UseTheForce ¶
UseTheForce deletes the use entry from etcd; useful for clearing a stale mount.
func VolumeCreate ¶
VolumeCreate creates a new volume with a JSON specification to store its information.
func VolumeForceRemove ¶
VolumeForceRemove removes a volume forcefully.
func VolumeList ¶
VolumeList prints the list of volumes for a pool.
func VolumeListAll ¶
VolumeListAll returns a list of the pools the apiserver knows about.
func VolumeRemove ¶
VolumeRemove removes a volume, deleting the image beneath it.
func VolumeRuntimeGet ¶
VolumeRuntimeGet retrieves the runtime configuration for a volume.
func VolumeRuntimeUpload ¶
VolumeRuntimeUpload retrieves the runtime configuration for a volume.
func VolumeSnapshotCopy ¶
VolumeSnapshotCopy lists all snapshots for a given volume.
func VolumeSnapshotList ¶
VolumeSnapshotList lists all snapshots for a given volume.
func VolumeSnapshotTake ¶
VolumeSnapshotTake takes a snapshot for a volume immediately.
Types ¶
This section is empty.