apiclient

package
v0.0.0-...-5efa5bd Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2017 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	URL       string
	Transport *http.Transport
}

APIClient struct

func NewAPIClient

func NewAPIClient(url, caFile string, insecure bool, poolSize int) (*APIClient, error)

NewAPIClient returns a new api client

func (*APIClient) Admin

func (api *APIClient) Admin(user, token string) bool

Admin Checks if the submitted user has admin privileges

func (*APIClient) Audit

func (api *APIClient) Audit(date, token string) (a []core.Audit, msg string, err error)

Audit calls the api to get audits

func (*APIClient) CSRs

func (api *APIClient) CSRs(token string) (c []core.CSR, msg string, err error)

CSRs calls the api to get all pending csr

func (*APIClient) Client

func (api *APIClient) Client(host, token string) (c core.Client, msg string, err error)

Client calls the api to get a single client

func (*APIClient) ClientAction

func (api *APIClient) ClientAction(hosts []string, action, delay, token string) (string, error)

ClientAction calls the api to submit a client action

func (*APIClient) ClientPackageAction

func (api *APIClient) ClientPackageAction(host, action, delay, token string, list []string) (string, error)

ClientPackageAction calls the api to submit a client package action

func (*APIClient) Clients

func (api *APIClient) Clients(token string) (c []core.Client, msg string, err error)

Clients calls the api to get all clients

func (*APIClient) ClientsSlice

func (api *APIClient) ClientsSlice(token string) ([]string, string, error)

ClientsSlice returns a string slice of all clients

func (*APIClient) CreateGroup

func (api *APIClient) CreateGroup(group *core.Group, token string) (string, error)

CreateGroup calls the api to create a group

func (*APIClient) CreateUser

func (api *APIClient) CreateUser(user, password, enabled, admin, token string) (string, error)

CreateUser calls the api to create a user

func (*APIClient) DelCSRs

func (api *APIClient) DelCSRs(token string) (string, error)

DelCSRs calls the api to get unsinged clients

func (*APIClient) DeleteGroup

func (api *APIClient) DeleteGroup(name, token string) (string, error)

DeleteGroup calls the api to delete a group

func (*APIClient) DeleteUser

func (api *APIClient) DeleteUser(user, token string) (string, error)

DeleteUser calls the api to delete a user

func (*APIClient) Group

func (api *APIClient) Group(name, token string) (g core.Group, msg string, err error)

Group calls the api to get a single group

func (*APIClient) GroupClients

func (api *APIClient) GroupClients(name, token string) (c []core.Client, msg string, err error)

GroupClients calls the api to get clients of a group

func (*APIClient) GroupMemberClients

func (api *APIClient) GroupMemberClients(name, token string) (m map[string]bool, msg string, err error)

GroupMemberClients calls the api to get clients of a group

func (*APIClient) GroupMemberPackages

func (api *APIClient) GroupMemberPackages(name, token string) (pack []core.PackageList, msg string, err error)

GroupMemberPackages calls the api to get all packages of a group

func (*APIClient) GroupMemberUsers

func (api *APIClient) GroupMemberUsers(name, token string) (m map[string]bool, msg string, err error)

GroupMemberUsers calls the api to get users of a group

func (*APIClient) Groups

func (api *APIClient) Groups(token string) (g []core.Group, msg string, err error)

Groups calls the api to get all groups

func (*APIClient) Login

func (api *APIClient) Login(user, password, method string) (msg, token string, err error)

Login calls the api to log into the api and receive a session token

func (*APIClient) Logout

func (api *APIClient) Logout(token string) (err error)

Logout calls the api to logout and blacklist the JWT

func (*APIClient) Methods

func (api *APIClient) Methods() (s []string, msg string, err error)

Methods calls the api to get all server authentication methods

func (*APIClient) PackageClients

func (api *APIClient) PackageClients(name, pack, token string) (c []core.PackageClient, msg string, err error)

PackageClients calls the api to get clients of a group

func (*APIClient) SetComment

func (api *APIClient) SetComment(host, comment, token string) (string, error)

SetComment calls the api to set a client comment

func (*APIClient) SignCSRs

func (api *APIClient) SignCSRs(host, token string) (string, error)

SignCSRs calls the api to sign the submitted csrs

func (*APIClient) Stats

func (api *APIClient) Stats(token string) (s core.Stats, msg string, err error)

Stats calls the api to get current server statistics

func (*APIClient) Unlock

func (api *APIClient) Unlock(user string, token string) (string, error)

Unlock calls the api to unlock a user

func (*APIClient) UpdateGroup

func (api *APIClient) UpdateGroup(group *core.Group, token string) (string, error)

UpdateGroup calls the api to update a group

func (*APIClient) UpdateUser

func (api *APIClient) UpdateUser(user, password, enabled, admin, token string) (string, error)

UpdateUser calls the api to update a user

func (*APIClient) User

func (api *APIClient) User(user, token string) (u core.User, msg string, err error)

User calls the api to get a single user

func (*APIClient) UserGroups

func (api *APIClient) UserGroups(token string) (g []core.Group, msg string, err error)

UserGroups calls the api to get groups of a user

func (*APIClient) Users

func (api *APIClient) Users(token string) (u []core.User, msg string, err error)

Users calls the api to get all users

func (*APIClient) UsersSlice

func (api *APIClient) UsersSlice(token string) ([]string, string, error)

UsersSlice returns a string slice of all users

Jump to

Keyboard shortcuts

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