Documentation ¶
Index ¶
- Constants
- func AreCertsSame(p common.Printer, server, local []byte) bool
- func AreCertsTrusted(host string, certs []byte) (bool, error)
- func ConfigDir() (string, error)
- func ControllerCreate(api API, entityType string, body string, out io.Writer, ...) (*gabs.Container, error)
- func ControllerDelete(api API, entityType string, id string, body string, out io.Writer, ...) (error, *int)
- func ControllerDetailEntity(api API, entityType, entityId string, logJSON bool, out io.Writer, timeout int, ...) (*gabs.Container, error)
- func ControllerList(api API, path string, params url.Values, logJSON bool, out io.Writer, ...) (*gabs.Container, error)
- func ControllerUpdate(api API, entityType string, body string, out io.Writer, method string, ...) (*gabs.Container, error)
- func CopyFile(src, dst string) (err error)
- func EdgeControllerGetManagementApiBasePath(host string, cert string) string
- func EdgeControllerList(path string, params url.Values, logJSON bool, out io.Writer, timeout int, ...) (*gabs.Container, error)
- func EdgeControllerListSubEntities(entityType, subType, entityId string, filter string, logJSON bool, ...) (*gabs.Container, error)
- func EdgeControllerRequest(entityType string, out io.Writer, logJSON bool, timeout int, verbose bool, ...) (*gabs.Container, error)
- func EdgeControllerVerify(entityType, id, body string, out io.Writer, logJSON bool, timeout int, ...) error
- func EnvironmentsDir() (string, error)
- func GetWellKnownCerts(host string) ([]byte, []*x509.Certificate, error)
- func HomeDir() string
- func IsServerTrusted(host string) (bool, error)
- func LogReleaseVersionCheck(zitiComponent string)
- func NewClient() *resty.Client
- func NewEdgeManagementClient(clientOpts ClientOpts) (*rest_management_api_client.ZitiEdgeManagement, error)
- func NewEmptyParentCmd(name string, description string) *cobra.Command
- func NewFabricManagementClient(clientOpts ClientOpts) (*fabric_rest_client.ZitiFabric, error)
- func NewRequest(restClientIdentity RestClientIdentity, timeoutInSeconds int, verbose bool) (*resty.Request, error)
- func OutputJson(out io.Writer, data []byte)
- func PKIRootDir() (string, error)
- func PersistRestClientConfig(config *RestClientConfig) error
- func PickName(names []string, message string) (string, error)
- func PickNameWithDefault(names []string, message string, defaultValue string) (string, error)
- func PickValue(message string, defaultValue string, required bool) (string, error)
- func PrettyPrintResponse(resp *resty.Response) string
- func ReadCert(id string) ([]byte, string, error)
- func ReloadConfig()
- func WrapIfApiError(err error) error
- func WriteCert(p common.Printer, id string, cert []byte) (string, error)
- type API
- type ApiErrorPayload
- type ClientOpts
- type EdgeManagementAuth
- type RestApiError
- type RestClientConfig
- type RestClientEdgeIdentity
- func (self *RestClientEdgeIdentity) GetBaseUrlForApi(api API) (string, error)
- func (self *RestClientEdgeIdentity) IsReadOnly() bool
- func (self *RestClientEdgeIdentity) NewClient(timeout time.Duration, verbose bool) (*resty.Client, error)
- func (self *RestClientEdgeIdentity) NewEdgeManagementClient(clientOpts ClientOpts) (*rest_management_api_client.ZitiEdgeManagement, error)
- func (self *RestClientEdgeIdentity) NewFabricManagementClient(clientOpts ClientOpts) (*fabric_rest_client.ZitiFabric, error)
- func (self *RestClientEdgeIdentity) NewRequest(client *resty.Client) *resty.Request
- func (self *RestClientEdgeIdentity) NewTlsClientConfig() (*tls.Config, error)
- func (self *RestClientEdgeIdentity) NewWsHeader() http.Header
- type RestClientIdentity
Constants ¶
const (
DefaultWritePermissions = 0760
)
Variables ¶
This section is empty.
Functions ¶
func AreCertsTrusted ¶ added in v0.27.0
func ControllerCreate ¶ added in v0.27.0
func ControllerCreate(api API, entityType string, body string, out io.Writer, logRequestJson, logResponseJson bool, timeout int, verbose bool) (*gabs.Container, error)
ControllerCreate will create entities of the given type in the given Edge Controller
func ControllerDelete ¶ added in v0.27.0
func ControllerDelete(api API, entityType string, id string, body string, out io.Writer, logRequestJson bool, logResponseJson bool, timeout int, verbose bool) (error, *int)
ControllerDelete will delete entities of the given type in the given Controller
func ControllerDetailEntity ¶ added in v0.27.0
func ControllerList ¶ added in v0.27.0
func ControllerList(api API, path string, params url.Values, logJSON bool, out io.Writer, timeout int, verbose bool) (*gabs.Container, error)
ControllerList will list entities of the given type in the given Edge Controller
func ControllerUpdate ¶ added in v0.27.0
func ControllerUpdate(api API, entityType string, body string, out io.Writer, method string, logRequestJson, logResponseJSON bool, timeout int, verbose bool) (*gabs.Container, error)
ControllerUpdate will update entities of the given type in the given Edge Controller
func CopyFile ¶ added in v0.27.0
credit https://gist.github.com/r0l1/92462b38df26839a3ca324697c8cba04
func EdgeControllerGetManagementApiBasePath ¶ added in v0.27.0
EdgeControllerGetManagementApiBasePath accepts host as `http://domain:port` and attempts to determine the proper path that should be used to access the Edge Management API. Depending on the version of the Edge Controller the API may be monolith on `/edge/<version>` and `/` or split into `/edge/management/<version>` and `/edge/client/<version>`.
func EdgeControllerList ¶ added in v0.27.0
func EdgeControllerList(path string, params url.Values, logJSON bool, out io.Writer, timeout int, verbose bool) (*gabs.Container, error)
EdgeControllerList will list entities of the given type in the given Edge Controller
func EdgeControllerListSubEntities ¶ added in v0.27.0
func EdgeControllerListSubEntities(entityType, subType, entityId string, filter string, logJSON bool, out io.Writer, timeout int, verbose bool) (*gabs.Container, error)
EdgeControllerListSubEntities will list entities of the given type in the given Edge Controller
func EdgeControllerRequest ¶ added in v0.27.0
func EdgeControllerVerify ¶ added in v0.27.0
func EdgeControllerVerify(entityType, id, body string, out io.Writer, logJSON bool, timeout int, verbose bool) error
EdgeControllerVerify will verify entities of the given type in the given Edge Controller
func EnvironmentsDir ¶ added in v0.27.0
func GetWellKnownCerts ¶ added in v0.27.0
func GetWellKnownCerts(host string) ([]byte, []*x509.Certificate, error)
func IsServerTrusted ¶ added in v0.27.0
func LogReleaseVersionCheck ¶ added in v0.27.0
func LogReleaseVersionCheck(zitiComponent string)
func NewClient ¶ added in v0.28.0
func NewClient() *resty.Client
Use a 2-second timeout with a retry count of 5
func NewEdgeManagementClient ¶ added in v0.27.0
func NewEdgeManagementClient(clientOpts ClientOpts) (*rest_management_api_client.ZitiEdgeManagement, error)
func NewEmptyParentCmd ¶ added in v0.27.0
NewEmptyParentCmd creates a new cobra command with no parent
func NewFabricManagementClient ¶ added in v0.27.0
func NewFabricManagementClient(clientOpts ClientOpts) (*fabric_rest_client.ZitiFabric, error)
func NewRequest ¶ added in v0.27.0
func NewRequest(restClientIdentity RestClientIdentity, timeoutInSeconds int, verbose bool) (*resty.Request, error)
func OutputJson ¶ added in v0.28.0
func PKIRootDir ¶ added in v0.27.0
func PersistRestClientConfig ¶ added in v0.27.0
func PersistRestClientConfig(config *RestClientConfig) error
func PickNameWithDefault ¶ added in v0.27.0
func PrettyPrintResponse ¶ added in v0.28.0
func PrettyPrintResponse(resp *resty.Response) string
func ReloadConfig ¶ added in v1.1.3
func ReloadConfig()
func WrapIfApiError ¶ added in v0.27.0
Types ¶
type ApiErrorPayload ¶ added in v0.27.0
type ApiErrorPayload interface { Error() string GetPayload() *rest_model.APIErrorEnvelope }
type ClientOpts ¶ added in v0.27.0
type EdgeManagementAuth ¶ added in v0.27.0
type EdgeManagementAuth struct {
Token string
}
func (EdgeManagementAuth) AuthenticateRequest ¶ added in v0.27.0
func (e EdgeManagementAuth) AuthenticateRequest(request openApiRuntime.ClientRequest, registry strfmt.Registry) error
type RestApiError ¶ added in v0.27.0
type RestApiError struct {
ApiErrorPayload
}
func (RestApiError) Error ¶ added in v0.27.0
func (a RestApiError) Error() string
type RestClientConfig ¶ added in v0.27.0
type RestClientConfig struct { EdgeIdentities map[string]*RestClientEdgeIdentity `json:"edgeIdentities"` Default string `json:"default"` }
func LoadRestClientConfig ¶ added in v0.27.0
func LoadRestClientConfig() (*RestClientConfig, string, error)
func (*RestClientConfig) GetIdentity ¶ added in v0.27.0
func (self *RestClientConfig) GetIdentity() string
type RestClientEdgeIdentity ¶ added in v0.27.0
type RestClientEdgeIdentity struct { Url string `json:"url"` Username string `json:"username"` Token string `json:"token"` LoginTime string `json:"loginTime"` CaCert string `json:"caCert,omitempty"` ReadOnly bool `json:"readOnly"` }
func (*RestClientEdgeIdentity) GetBaseUrlForApi ¶ added in v0.27.0
func (self *RestClientEdgeIdentity) GetBaseUrlForApi(api API) (string, error)
func (*RestClientEdgeIdentity) IsReadOnly ¶ added in v0.27.0
func (self *RestClientEdgeIdentity) IsReadOnly() bool
func (*RestClientEdgeIdentity) NewClient ¶ added in v0.27.0
func (self *RestClientEdgeIdentity) NewClient(timeout time.Duration, verbose bool) (*resty.Client, error)
func (*RestClientEdgeIdentity) NewEdgeManagementClient ¶ added in v0.27.0
func (self *RestClientEdgeIdentity) NewEdgeManagementClient(clientOpts ClientOpts) (*rest_management_api_client.ZitiEdgeManagement, error)
func (*RestClientEdgeIdentity) NewFabricManagementClient ¶ added in v0.27.0
func (self *RestClientEdgeIdentity) NewFabricManagementClient(clientOpts ClientOpts) (*fabric_rest_client.ZitiFabric, error)
func (*RestClientEdgeIdentity) NewRequest ¶ added in v0.27.0
func (self *RestClientEdgeIdentity) NewRequest(client *resty.Client) *resty.Request
func (*RestClientEdgeIdentity) NewTlsClientConfig ¶ added in v0.27.0
func (self *RestClientEdgeIdentity) NewTlsClientConfig() (*tls.Config, error)
func (*RestClientEdgeIdentity) NewWsHeader ¶ added in v0.27.0
func (self *RestClientEdgeIdentity) NewWsHeader() http.Header
type RestClientIdentity ¶ added in v0.27.0
type RestClientIdentity interface { NewTlsClientConfig() (*tls.Config, error) NewClient(timeout time.Duration, verbose bool) (*resty.Client, error) NewRequest(client *resty.Client) *resty.Request IsReadOnly() bool GetBaseUrlForApi(api API) (string, error) NewEdgeManagementClient(clientOpts ClientOpts) (*rest_management_api_client.ZitiEdgeManagement, error) NewFabricManagementClient(clientOpts ClientOpts) (*fabric_rest_client.ZitiFabric, error) NewWsHeader() http.Header }
func LoadSelectedIdentity ¶ added in v0.27.0
func LoadSelectedIdentity() (RestClientIdentity, error)
func LoadSelectedRWIdentity ¶ added in v0.27.0
func LoadSelectedRWIdentity() (RestClientIdentity, error)