Documentation
¶
Index ¶
- Constants
- func Login(httpClient *RestClient, uri, pUsername, pPassword string) string
- func NewHttpError(code int, theMsg string) error
- type API
- func (api *API) CreateCluster(orgId, environment string, cluster *Cluster) (string, error)
- func (api *API) DeleteCluster(orgId, environmentName, clusterName string) (interface{}, error)
- func (api *API) FindEnvironmentByName(orgId, environment string) (map[string]interface{}, error)
- func (api *API) GetAllServers(orgId, environment string) ([]interface{}, error)
- func (api *API) GetApplicationByName(orgId, environment, appName string) (map[string]interface{}, error)
- func (api *API) GetApplications(orgId, environment string) ([]interface{}, error)
- func (api *API) GetEndpointAsJSONString(orgId string, apiId, versionId int) (string, error)
- func (api *API) GetEndpointAsMap(orgId string, apiId, versionId int) (map[string]interface{}, error)
- func (api *API) SearchAPIAsJSON(orgID string, params *SearchParameters) (map[string]interface{}, error)
- func (api *API) SearchAPIAsString(orgID string, params *SearchParameters) (string, error)
- func (api *API) SearchAllApplicationsByName(orgId, environment, appName string) ([]interface{}, error)
- func (api *API) SearchServers(orgId, environment, serverName string) ([]interface{}, error)
- func (api *API) SetEndpoint(endpoint *Endpoint) error
- type Auth
- type AuthToken
- type Cluster
- type ClusterServer
- type Clusters
- type ContentType
- type Endpoint
- type Filters
- type HttpError
- type LoginPayload
- type RestClient
- func (client *RestClient) AddAuthHeader(token string) *RestClient
- func (client *RestClient) AddEnvHeader(envId string) *RestClient
- func (client *RestClient) AddHeader(key, value string) *RestClient
- func (client *RestClient) AddOrgHeader(orgId string) *RestClient
- func (client *RestClient) DELETE(body interface{}, path string, cType ContentType, responseObj interface{}) (*http.Response, error)
- func (client *RestClient) GET(path string) ([]byte, error)
- func (client *RestClient) PATCH(body interface{}, path string, cType ContentType, responseObj interface{}) (*http.Response, error)
- func (client *RestClient) POST(body interface{}, path string, cType ContentType, responseObj interface{}) (*http.Response, error)
- type SearchParameters
Constants ¶
View Source
const ( BASE_PATH = "/apiplatform/repository/v2" ORG_PATH = "/organizations/{orgId}" SEARCH_API_PATH = "/apis?ascending=false&limit={limit}&offset={offset}&query={APIName}&sort={sortOrder}" API_PATH = BASE_PATH + ORG_PATH + "/apis/{apiId}" VERSION_PATH = API_PATH + "/versions/{versionId}" API_ENDPOINT_PATH = VERSION_PATH + "/endpoint" ENVIRONMENTS = "/accounts/api/organizations/{orgId}/environments" ARM = "/armui/api/v1" APPLICATIONS = ARM + "/applications" SERVERS = ARM + "/servers" HYBRID = "/hybrid/api/v1" CLUSTERS = HYBRID + "/clusters" CLUSTER = HYBRID + "/clusters/{clusterId}" )
View Source
const ( LOGIN string = "/accounts/login" ME string = "/accounts/api/me" HIERARCHY string = "/accounts/api/organizations/{orgId}/hierarchy" )
Variables ¶
This section is empty.
Functions ¶
func Login ¶
func Login(httpClient *RestClient, uri, pUsername, pPassword string) string
Login the given user and return the bearer Token
func NewHttpError ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewAPIWithCredentials ¶
func (*API) CreateCluster ¶
* UNICAST REQUEST: POST
{
"name":"UNICAST",
"multicastEnabled":false,
"servers":[
{
"serverId":20,
"serverIp":"10.8.8.3"
},
{
"serverId":19,
"serverIp":"10.8.8.3"
}
]
}
MULTICAST REQUEST:
{
"name":"MULTICAST",
"multicastEnabled":true,
"servers":[
{"serverId":20},
{"serverId":19}
]
}
func (*API) DeleteCluster ¶
func (*API) FindEnvironmentByName ¶
func (*API) GetAllServers ¶
func (*API) GetApplicationByName ¶
func (*API) GetApplications ¶
func (*API) GetEndpointAsJSONString ¶
func (*API) GetEndpointAsMap ¶
func (*API) SearchAPIAsJSON ¶
func (api *API) SearchAPIAsJSON(orgID string, params *SearchParameters) (map[string]interface{}, error)
SearchAPIAsJSON - Search an API by name
func (*API) SearchAPIAsString ¶
func (api *API) SearchAPIAsString(orgID string, params *SearchParameters) (string, error)
func (*API) SearchAllApplicationsByName ¶
func (*API) SearchServers ¶
func (*API) SetEndpoint ¶
type Auth ¶
type Auth struct {
Token string
// contains filtered or unexported fields
}
func NewAuthWithCredentials ¶
func NewAuthWithToken ¶
func (*Auth) FindBusinessGroup ¶
type Cluster ¶
type Cluster struct {
ClusterName string `yaml:"cluster_name" json:"name"`
Multicast bool `yaml:"mulsticast" json:"multicastEnabled"`
Servers []ClusterServer `yaml:"servers" json:"servers"`
}
type ClusterServer ¶
type ContentType ¶
type ContentType int
const ( Application_Json ContentType = iota Application_OctetStream Application_Pdf Application_Atom_Xml Application_Form_Urlencoded Application_SVG_XML Application_XHTML_XML Application_XML Multipart_Form_Data Text_HTML Text_Plain Text_XML Wildcard )
type Endpoint ¶
type Endpoint struct {
Id int `json:"id"`
OrgID string `json:"masterOrganizationId"`
ApiID int
VersionID int `json:"apiVersionId"`
Type string `json:"type"`
Uri string `json:"uri"`
ProxyUri string `json:"proxyUri"`
ProxyRegistrationUri string `json:"proxyRegistrationUri"`
IsCloudHub bool `json:"isCloudHub"`
ReferencesUserDomain bool `json:"referencesUserDomain"`
ResponseTimeout int `json:"responseTimeout"`
}
type LoginPayload ¶
type RestClient ¶
func NewRestClient ¶
func NewRestClient(uri string) *RestClient
func (*RestClient) AddAuthHeader ¶
func (client *RestClient) AddAuthHeader(token string) *RestClient
func (*RestClient) AddEnvHeader ¶
func (client *RestClient) AddEnvHeader(envId string) *RestClient
func (*RestClient) AddHeader ¶
func (client *RestClient) AddHeader(key, value string) *RestClient
func (*RestClient) AddOrgHeader ¶
func (client *RestClient) AddOrgHeader(orgId string) *RestClient
func (*RestClient) DELETE ¶
func (client *RestClient) DELETE(body interface{}, path string, cType ContentType, responseObj interface{}) (*http.Response, error)
DELETE - Perform an HTTP DELETE
func (*RestClient) PATCH ¶
func (client *RestClient) PATCH(body interface{}, path string, cType ContentType, responseObj interface{}) (*http.Response, error)
PATCH - Perform an HTTP PATCH
func (*RestClient) POST ¶
func (client *RestClient) POST(body interface{}, path string, cType ContentType, responseObj interface{}) (*http.Response, error)
POST - Perform an HTTP POST
Click to show internal directories.
Click to hide internal directories.