Documentation ¶
Index ¶
- func CreateExampleAccountCSV() error
- func NewAccount(fullname, username, password string, isActive, isOrg, isAdmin, searchLDAP bool) *ucptypes.Account
- func NewOrg(fullname, username, password string, isActive, isAdmin, searchLDAP bool) *ucptypes.Account
- func NewUser(fullname, username, password string, isActive, isAdmin, searchLDAP bool) *ucptypes.Account
- func ParseUCPError(response []byte) error
- func SetActiveSession(sessionID int) error
- type BuildPlan
- type Client
- func (c *Client) AddAccount(account *ucptypes.Account) error
- func (c *Client) AddTeamToOrganisation(team *ucptypes.Team, org string) error
- func (c *Client) AddUserToOrganisation(user, org string) error
- func (c *Client) AddUserToTeam(user, org, team string) error
- func (c *Client) AuthStatus() (*ucptypes.Account, error)
- func (c *Client) BuildImage(b *BuildPlan) error
- func (c *Client) ConfigureHRM(interlockConfig ucptypes.InterlockConfig) error
- func (c *Client) ConfigureInterlock(config ucptypes.InterlockConfig) error
- func (c *Client) Connect() error
- func (c *Client) ContainerTop() error
- func (c *Client) CreateCollection(name, parentID string) error
- func (c *Client) CreateConfig(name, path string) error
- func (c *Client) CreateRole(name, id, ruleset string, systemRole bool) error
- func (c *Client) DelUserFromTeam(user, org, team string) error
- func (c *Client) DeleteAccount(account string) error
- func (c *Client) DeleteClientBundle(user, keyID string) error
- func (c *Client) DeleteCollection(collectionID string) error
- func (c *Client) DeleteGrant(collection, role, subject string) error
- func (c *Client) DeleteNode(id string, force bool) error
- func (c *Client) DeleteRole(account string) error
- func (c *Client) DeleteTeamFromOrganisation(team, org string) error
- func (c *Client) Disconnect() error
- func (c *Client) ExportAccountsToCSV(path string) error
- func (c *Client) GetAccounts(query ucptypes.Account, count int) (*ucptypes.AccountList, error)
- func (c *Client) GetAllContainers() ([]types.Container, error)
- func (c *Client) GetAllServices() ([]swarm.Service, error)
- func (c *Client) GetAvailavleUCPVersions() ([]string, error)
- func (c *Client) GetClientBundle() error
- func (c *Client) GetCollection(collectionID string) (*ucptypes.Collection, error)
- func (c *Client) GetCollections() ([]ucptypes.Collection, error)
- func (c *Client) GetConfig(id string) (*ucptypes.ServiceConfig, error)
- func (c *Client) GetContainerCount() error
- func (c *Client) GetContainerFromID(id string) (*types.ContainerJSON, error)
- func (c *Client) GetContainerProcesses(id string) (*ucptypes.ContainerProcesses, error)
- func (c *Client) GetGrants(resolve bool) error
- func (c *Client) GetLDAPInfo() (*ucptypes.LDAPConfig, error)
- func (c *Client) GetNetworkFromID(id string) (*types.NetworkResource, error)
- func (c *Client) GetNetworks() ([]types.NetworkResource, error)
- func (c *Client) GetNode(id string) (swarm.Node, error)
- func (c *Client) GetRoleRuleset(role string, id string) (string, error)
- func (c *Client) GetRoles() error
- func (c *Client) GetService(service string) (*swarm.Service, error)
- func (c *Client) GetServiceDifference(serviceName string, pretty bool) (string, error)
- func (c *Client) GetServiceTasks(serviceName string) ([]swarm.Task, error)
- func (c *Client) GetSupportDump() error
- func (c *Client) GetSwarmInfo() (*swarm.ClusterInfo, error)
- func (c *Client) GetTeams(org string) error
- func (c *Client) GetUCPVersion() (string, error)
- func (c *Client) ImportAccountsFromCSV(path string) error
- func (c *Client) ListAllNodes() ([]swarm.Node, error)
- func (c *Client) ListClientBundles(user string) (*ucptypes.ClientBundles, error)
- func (c *Client) ListConfigs() ([]ucptypes.ServiceConfig, error)
- func (c *Client) NetworkConnectContainer(containerID, networkID, ipv4, ipv6 string) error
- func (c *Client) NetworkDisconnectContainer(containerID, networkID string, force bool) error
- func (c *Client) ReapFailedTasks(serviceName string, rmvol, kill bool) error
- func (c *Client) RenameClientBundle(user, keyID, name string) error
- func (c *Client) SetCollection(collectionID string, constraint *ucptypes.CollectionLabelConstraints) error
- func (c *Client) SetDefaultCollection(collectionID, user string) error
- func (c *Client) SetGrant(collection, role, subject string, flags uint) error
- func (c *Client) SetLDAPInfo(cfg *ucptypes.LDAPConfig) error
- func (c *Client) SetNodeAvailability(id, s string) error
- func (c *Client) SetNodeLabel(id, k, v string) error
- func (c *Client) SetNodeRole(id, r string) error
- func (c *Client) SetSwarmCluster(version string, swm *swarm.Spec) error
- func (c *Client) TotalRole() ([]byte, error)
- func (c *Client) UpgradeUCP(version string) error
- func (c *Client) WriteToken() error
- type ClientSession
- type ServiceQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
ParseUCPError - This will read through the return from UCP and report the error
func SetActiveSession ¶
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 ¶
NewBasicAuthClient - Creates a basic client to connecto the UCP
func (*Client) AddAccount ¶
AddAccount - adds a new account to UCP
func (*Client) AddTeamToOrganisation ¶
AddTeamToOrganisation - adds a team to an existing organisation
func (*Client) AddUserToOrganisation ¶
AddUserToOrganisation - Adds a user to an existing organisation TODO
func (*Client) AddUserToTeam ¶
AddUserToTeam - adds a team to an existing organisation
func (*Client) AuthStatus ¶
AuthStatus - will return the current logged in user
func (*Client) BuildImage ¶
BuildImage - This will return a list of services
func (*Client) ConfigureHRM ¶
ConfigureHRM - This will toggle the functionality to enable Image Scanning
func (*Client) ConfigureInterlock ¶
ConfigureInterlock - This will toggle the functionality to enable Image Scanning
func (*Client) CreateCollection ¶
CreateCollection - This will get all accounts
func (*Client) CreateConfig ¶
CreateConfig - This will return a list of services
func (*Client) CreateRole ¶
CreateRole - This set the role of a user in an organisation
func (*Client) DelUserFromTeam ¶
DelUserFromTeam - deletes a user from a team in an existing organisation
func (*Client) DeleteAccount ¶
DeleteAccount - deletes an account in UCP
func (*Client) DeleteClientBundle ¶
DeleteClientBundle - will delete the selected UCP Client Bundle
func (*Client) DeleteCollection ¶
DeleteCollection - This will get all accounts
func (*Client) DeleteGrant ¶
DeleteGrant - This function will remove an existing grant
func (*Client) DeleteNode ¶
DeleteNode - Set the node availability (Active/Pause/Drain)
func (*Client) DeleteRole ¶
DeleteRole - deletes a role in UCP
func (*Client) DeleteTeamFromOrganisation ¶
DeleteTeamFromOrganisation - deletes an account in UCP
func (*Client) ExportAccountsToCSV ¶
ExportAccountsToCSV -
func (*Client) GetAccounts ¶
GetAccounts - This will get all accounts
func (*Client) GetAllContainers ¶
GetAllContainers - Returns all containers in the cluster
func (*Client) GetAllServices ¶
GetAllServices - This will return a list of services
func (*Client) GetAvailavleUCPVersions ¶
GetAvailavleUCPVersions - this will start the upgrade procedure to a newer version
func (*Client) GetClientBundle ¶
GetClientBundle - will download the UCP Client Bundle
func (*Client) GetCollection ¶
GetCollection - This will get all accounts
func (*Client) GetCollections ¶
GetCollections - This will get all collections
func (*Client) GetContainerCount ¶
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 ¶
GetContainerProcesses - Returns all containers in the cluster
func (*Client) GetGrants ¶
GetGrants - This will return a list of all grants, it can also resolve the UUIDs to names
func (*Client) GetLDAPInfo ¶
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 ¶
GetNode - Retrieves the complete list of all nodes connected to a UCP cluster
func (*Client) GetRoleRuleset ¶
GetRoleRuleset - This will return a list of rules attached to a role
func (*Client) GetService ¶
GetService - This will return a list of services
func (*Client) GetServiceDifference ¶
GetServiceDifference - This will compare a service spec and previous spec and output the differences
func (*Client) GetServiceTasks ¶
GetServiceTasks - This returns all tasks associated with a service
func (*Client) GetSupportDump ¶
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) GetUCPVersion ¶
GetUCPVersion - this returns the running version of the current session
func (*Client) ImportAccountsFromCSV ¶
ImportAccountsFromCSV - This will import accounts from a CSV file and create/delete them as described in the CSV
func (*Client) ListAllNodes ¶
ListAllNodes - Retrieves the complete list of all nodes connected to a UCP cluster
func (*Client) ListClientBundles ¶
ListClientBundles - will list UCP Client Bundle
func (*Client) ListConfigs ¶
ListConfigs - This will return a list of services
func (*Client) NetworkConnectContainer ¶
NetworkConnectContainer - Connect a container to a network
func (*Client) NetworkDisconnectContainer ¶
NetworkDisconnectContainer - This will remove a container from the network
func (*Client) ReapFailedTasks ¶
ReapFailedTasks - This returns all tasks associated with a service
func (*Client) RenameClientBundle ¶
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 ¶
SetDefaultCollection - This will get all accounts
func (*Client) SetGrant ¶
SetGrant - This takes a subject and a role (ruleset) and applies it to a collection
func (*Client) SetLDAPInfo ¶
SetLDAPInfo - returns all information about the LDAP configuration
func (*Client) SetNodeAvailability ¶
SetNodeAvailability - Set the node availability (Active/Pause/Drain)
func (*Client) SetNodeLabel ¶
SetNodeLabel - Retrieves the complete list of all nodes connected to a UCP cluster
func (*Client) SetNodeRole ¶
SetNodeRole - Set the node availability (Active/Pause/Drain)
func (*Client) SetSwarmCluster ¶
SetSwarmCluster - takes an updated cluster configuration and applies it to the existing swarm version
func (*Client) UpgradeUCP ¶
UpgradeUCP - this will start the upgrade procedure to a newer version
func (*Client) WriteToken ¶
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