Documentation ¶
Index ¶
- Constants
- Variables
- func Execute()
- type Error
- type Master
- func (master *Master) Export(args []string) (string, error)
- func (master *Master) Import(args []string) error
- func (master *Master) Login() (string, string, error)
- func (master *Master) OnInit()
- func (master *Master) Run(method model.Method, args []string) error
- func (master *Master) Save(token, refresh string) error
- func (master *Master) SaveCookie(cookie []*http.Cookie) error
- func (master *Master) WebLogin() ([]*http.Cookie, error)
- func (master *Master) WebLogout() error
Constants ¶
View Source
const ( // ErrMissingPath returned when no path is provided for a REST op ErrMissingPath = Error("Missing path parameter for REST operation") // ErrMissingserver returned when there is no server to log in ErrMissingserver = Error("Missing CPPM server name or IP address") // ErrMissingCreds returned when there are no credentials to log in ErrMissingCreds = Error("Missing credentials to log into CPPM") // ErrInvalidCreds returned when not allowed to log in ErrInvalidCreds = Error("Credentials are invalid or expired") // ErrMissingResource returned when no resource is provided for export ErrMissingResource = Error("No resource specified for import/export") )
View Source
const DefaultPageSize = 24
DefaultPageSize is the default page size for pagination
Variables ¶
View Source
var RootCmd = &cobra.Command{
Use: "cpcli",
Short: "Command-line interface for Aruba Clearpass API",
Long: `cpcli (cp for short) is a command line application that interacts with
Aruba Clearpass through the REST API.
It performs:
- Authentication against Clearpass with the "login" command.
- GET, POST, PUT, PATCH, DELETE requests to the API.`,
}
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
type Master ¶
type Master struct { // Logger for error messages Log *log.Logger // Options to mamage with Cobra ConfigFile string Options term.Options Force bool Query []string // contains filtered or unexported fields }
Master is the master application object
var Singleton Master
Singleton is the config holder for all commands
func (*Master) OnInit ¶
func (master *Master) OnInit()
OnInit reads in config file and ENV variables if set.
func (*Master) SaveCookie ¶
SaveCookie saves weblogin cookie
Click to show internal directories.
Click to hide internal directories.