ucp

package
v0.0.0-...-8073d5e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateExampleAccountCSV

func CreateExampleAccountCSV() error

CreateExampleAccountCSV -

func NewAccount

func NewAccount(fullname, username, password string, isActive, isOrg, isAdmin, searchLDAP bool) *ucptypes.Account

NewAccount - Creates a new account within UCP

func NewOrg

func NewOrg(fullname, username, password string, isActive, isAdmin, searchLDAP bool) *ucptypes.Account

NewOrg - Creates a new organisation

func NewUser

func NewUser(fullname, username, password string, isActive, isAdmin, searchLDAP bool) *ucptypes.Account

NewUser - Creates a new user accound

func ParseUCPError

func ParseUCPError(response []byte) error

ParseUCPError - This will read through the return from UCP and report the error

func SetActiveSession

func SetActiveSession(sessionID int) error

SetActiveSession - this will set the active session

Types

type BuildPlan

type BuildPlan struct {
	// The name of the service to query
	GHURL     string
	Tag       string
	BuildHost string
}

BuildPlan - This collection of bools builds the output from a service query

type Client

type Client struct {
	Username   string
	Password   string
	UCPURL     string
	IgnoreCert bool
	Token      string
	UCPVersion string
}

Client - Is the basic Client struct

func NewBasicAuthClient

func NewBasicAuthClient(username, password, url string, ignoreCert bool) *Client

NewBasicAuthClient - Creates a basic client to connecto the UCP

func ReadToken

func ReadToken() (*Client, error)

ReadToken - Reads the token from a file

func (*Client) AddAccount

func (c *Client) AddAccount(account *ucptypes.Account) error

AddAccount - adds a new account to UCP

func (*Client) AddTeamToOrganisation

func (c *Client) AddTeamToOrganisation(team *ucptypes.Team, org string) error

AddTeamToOrganisation - adds a team to an existing organisation

func (*Client) AddUserToOrganisation

func (c *Client) AddUserToOrganisation(user, org string) error

AddUserToOrganisation - Adds a user to an existing organisation TODO

func (*Client) AddUserToTeam

func (c *Client) AddUserToTeam(user, org, team string) error

AddUserToTeam - adds a team to an existing organisation

func (*Client) AuthStatus

func (c *Client) AuthStatus() (*ucptypes.Account, error)

AuthStatus - will return the current logged in user

func (*Client) BuildImage

func (c *Client) BuildImage(b *BuildPlan) error

BuildImage - This will return a list of services

func (*Client) ConfigureHRM

func (c *Client) ConfigureHRM(interlockConfig ucptypes.InterlockConfig) error

ConfigureHRM - This will toggle the functionality to enable Image Scanning

func (*Client) ConfigureInterlock

func (c *Client) ConfigureInterlock(config ucptypes.InterlockConfig) error

ConfigureInterlock - This will toggle the functionality to enable Image Scanning

func (*Client) Connect

func (c *Client) Connect() error

Connect - Will attempt to connect to UCP

func (*Client) ContainerTop

func (c *Client) ContainerTop() error

ContainerTop -

func (*Client) CreateCollection

func (c *Client) CreateCollection(name, parentID string) error

CreateCollection - This will get all accounts

func (*Client) CreateConfig

func (c *Client) CreateConfig(name, path string) error

CreateConfig - This will return a list of services

func (*Client) CreateRole

func (c *Client) CreateRole(name, id, ruleset string, systemRole bool) error

CreateRole - This set the role of a user in an organisation

func (*Client) DelUserFromTeam

func (c *Client) DelUserFromTeam(user, org, team string) error

DelUserFromTeam - deletes a user from a team in an existing organisation

func (*Client) DeleteAccount

func (c *Client) DeleteAccount(account string) error

DeleteAccount - deletes an account in UCP

func (*Client) DeleteClientBundle

func (c *Client) DeleteClientBundle(user, keyID string) error

DeleteClientBundle - will delete the selected UCP Client Bundle

func (*Client) DeleteCollection

func (c *Client) DeleteCollection(collectionID string) error

DeleteCollection - This will get all accounts

func (*Client) DeleteGrant

func (c *Client) DeleteGrant(collection, role, subject string) error

DeleteGrant - This function will remove an existing grant

func (*Client) DeleteNode

func (c *Client) DeleteNode(id string, force bool) error

DeleteNode - Set the node availability (Active/Pause/Drain)

func (*Client) DeleteRole

func (c *Client) DeleteRole(account string) error

DeleteRole - deletes a role in UCP

func (*Client) DeleteTeamFromOrganisation

func (c *Client) DeleteTeamFromOrganisation(team, org string) error

DeleteTeamFromOrganisation - deletes an account in UCP

func (*Client) Disconnect

func (c *Client) Disconnect() error

Disconnect - TODO

func (*Client) ExportAccountsToCSV

func (c *Client) ExportAccountsToCSV(path string) error

ExportAccountsToCSV -

func (*Client) GetAccounts

func (c *Client) GetAccounts(query ucptypes.Account, count int) (*ucptypes.AccountList, error)

GetAccounts - This will get all accounts

func (*Client) GetAllContainers

func (c *Client) GetAllContainers() ([]types.Container, error)

GetAllContainers - Returns all containers in the cluster

func (*Client) GetAllServices

func (c *Client) GetAllServices() ([]swarm.Service, error)

GetAllServices - This will return a list of services

func (*Client) GetAvailavleUCPVersions

func (c *Client) GetAvailavleUCPVersions() ([]string, error)

GetAvailavleUCPVersions - this will start the upgrade procedure to a newer version

func (*Client) GetClientBundle

func (c *Client) GetClientBundle() error

GetClientBundle - will download the UCP Client Bundle

func (*Client) GetCollection

func (c *Client) GetCollection(collectionID string) (*ucptypes.Collection, error)

GetCollection - This will get all accounts

func (*Client) GetCollections

func (c *Client) GetCollections() ([]ucptypes.Collection, error)

GetCollections - This will get all collections

func (*Client) GetConfig

func (c *Client) GetConfig(id string) (*ucptypes.ServiceConfig, error)

GetConfig - This will return a list of services

func (*Client) GetContainerCount

func (c *Client) GetContainerCount() error

GetContainerCount - Returns the number of containers running

func (*Client) GetContainerFromID

func (c *Client) GetContainerFromID(id string) (*types.ContainerJSON, error)

GetContainerFromID - this will find a container and return it's struct

func (*Client) GetContainerProcesses

func (c *Client) GetContainerProcesses(id string) (*ucptypes.ContainerProcesses, error)

GetContainerProcesses - Returns all containers in the cluster

func (*Client) GetGrants

func (c *Client) GetGrants(resolve bool) error

GetGrants - This will return a list of all grants, it can also resolve the UUIDs to names

func (*Client) GetLDAPInfo

func (c *Client) GetLDAPInfo() (*ucptypes.LDAPConfig, error)

GetLDAPInfo - returns all information about the LDAP configuration

func (*Client) GetNetworkFromID

func (c *Client) GetNetworkFromID(id string) (*types.NetworkResource, error)

GetNetworkFromID - this will find a container and return it's struct

func (*Client) GetNetworks

func (c *Client) GetNetworks() ([]types.NetworkResource, error)

GetNetworks -

func (*Client) GetNode

func (c *Client) GetNode(id string) (swarm.Node, error)

GetNode - Retrieves the complete list of all nodes connected to a UCP cluster

func (*Client) GetRoleRuleset

func (c *Client) GetRoleRuleset(role string, id string) (string, error)

GetRoleRuleset - This will return a list of rules attached to a role

func (*Client) GetRoles

func (c *Client) GetRoles() error

GetRoles - This will print a list of services

func (*Client) GetService

func (c *Client) GetService(service string) (*swarm.Service, error)

GetService - This will return a list of services

func (*Client) GetServiceDifference

func (c *Client) GetServiceDifference(serviceName string, pretty bool) (string, error)

GetServiceDifference - This will compare a service spec and previous spec and output the differences

func (*Client) GetServiceTasks

func (c *Client) GetServiceTasks(serviceName string) ([]swarm.Task, error)

GetServiceTasks - This returns all tasks associated with a service

func (*Client) GetSupportDump

func (c *Client) GetSupportDump() error

GetSupportDump - will download a UCP support dump

func (*Client) GetSwarmInfo

func (c *Client) GetSwarmInfo() (*swarm.ClusterInfo, error)

GetSwarmInfo - returns all information about the swarm cluster

func (*Client) GetTeams

func (c *Client) GetTeams(org string) error

GetTeams - This will print a list of teams

func (*Client) GetUCPVersion

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

GetUCPVersion - this returns the running version of the current session

func (*Client) ImportAccountsFromCSV

func (c *Client) ImportAccountsFromCSV(path string) error

ImportAccountsFromCSV - This will import accounts from a CSV file and create/delete them as described in the CSV

func (*Client) ListAllNodes

func (c *Client) ListAllNodes() ([]swarm.Node, error)

ListAllNodes - Retrieves the complete list of all nodes connected to a UCP cluster

func (*Client) ListClientBundles

func (c *Client) ListClientBundles(user string) (*ucptypes.ClientBundles, error)

ListClientBundles - will list UCP Client Bundle

func (*Client) ListConfigs

func (c *Client) ListConfigs() ([]ucptypes.ServiceConfig, error)

ListConfigs - This will return a list of services

func (*Client) NetworkConnectContainer

func (c *Client) NetworkConnectContainer(containerID, networkID, ipv4, ipv6 string) error

NetworkConnectContainer - Connect a container to a network

func (*Client) NetworkDisconnectContainer

func (c *Client) NetworkDisconnectContainer(containerID, networkID string, force bool) error

NetworkDisconnectContainer - This will remove a container from the network

func (*Client) ReapFailedTasks

func (c *Client) ReapFailedTasks(serviceName string, rmvol, kill bool) error

ReapFailedTasks - This returns all tasks associated with a service

func (*Client) RenameClientBundle

func (c *Client) RenameClientBundle(user, keyID, name string) error

RenameClientBundle - will relabel / rename the selected UCP Client Bundle

func (*Client) SetCollection

func (c *Client) SetCollection(collectionID string, constraint *ucptypes.CollectionLabelConstraints) error

SetCollection - This will get all accounts

func (*Client) SetDefaultCollection

func (c *Client) SetDefaultCollection(collectionID, user string) error

SetDefaultCollection - This will get all accounts

func (*Client) SetGrant

func (c *Client) SetGrant(collection, role, subject string, flags uint) error

SetGrant - This takes a subject and a role (ruleset) and applies it to a collection

func (*Client) SetLDAPInfo

func (c *Client) SetLDAPInfo(cfg *ucptypes.LDAPConfig) error

SetLDAPInfo - returns all information about the LDAP configuration

func (*Client) SetNodeAvailability

func (c *Client) SetNodeAvailability(id, s string) error

SetNodeAvailability - Set the node availability (Active/Pause/Drain)

func (*Client) SetNodeLabel

func (c *Client) SetNodeLabel(id, k, v string) error

SetNodeLabel - Retrieves the complete list of all nodes connected to a UCP cluster

func (*Client) SetNodeRole

func (c *Client) SetNodeRole(id, r string) error

SetNodeRole - Set the node availability (Active/Pause/Drain)

func (*Client) SetSwarmCluster

func (c *Client) SetSwarmCluster(version string, swm *swarm.Spec) error

SetSwarmCluster - takes an updated cluster configuration and applies it to the existing swarm version

func (*Client) TotalRole

func (c *Client) TotalRole() ([]byte, error)

TotalRole - This will return all roles available in the system

func (*Client) UpgradeUCP

func (c *Client) UpgradeUCP(version string) error

UpgradeUCP - this will start the upgrade procedure to a newer version

func (*Client) WriteToken

func (c *Client) WriteToken() error

WriteToken - Writes a copy of the token to the

type ClientSession

type ClientSession struct {
	UCPAddress string `json:"address"`
	Token      string `json:"token"`
	IgnoreCert bool   `json:"ignoreCert"`
	Active     bool   `json:"active"`
	UCPVersion string `json:"version"`
}

ClientSession - returns everything needed to interact with UCP

func ReadAllClients

func ReadAllClients() ([]ClientSession, error)

ReadAllClients - This will read the token file and return all of the clients

type ServiceQuery

type ServiceQuery struct {
	// The name of the service to query
	ServiceName string

	// The query output
	ID       bool
	Networks bool
	State    bool
	Node     bool
	// Resolve UUIDs to Name
	Resolve bool
}

ServiceQuery - This collection of bools builds the output from a service query

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL