Documentation ¶
Index ¶
- Variables
- func GetContainer(resp *http.Response) (*gabs.Container, error)
- type V2
- func (c *V2) AsyncGet(endpoint string, queryParams *map[string]string) (*http.Response, *gabs.Container, error)
- func (c *V2) Create(endpoint string, model models.Model) (*http.Response, *gabs.Container, error)
- func (c *V2) Delete(endpoint string) (*http.Response, error)
- func (c *V2) Do(req *http.Request) (*http.Response, error)
- func (c *V2) Get(endpoint string, queryParams *map[string]string) (*http.Response, *gabs.Container, error)
- func (c *V2) PrepareModel(model models.Model) (*gabs.Container, error)
- func (c *V2) PrepareRequest(method string, endpoint string, body *gabs.Container, ...) (*http.Request, error)
- func (c *V2) Update(endpoint string, model models.Model) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrPayloadCreation = errors.New("error in creating payload")
)
Errors for V2 API client
Functions ¶
func GetContainer ¶
GetContainer parses HTTP Response and returns *gabs.Container
Types ¶
type V2 ¶
V2 client for Illumio REST APIs
func NewV2 ¶
func NewV2(hostURL string, orgID int, apiUsername string, apiKeySecret string, defaultTimeout int, rateLimiter *rate.Limiter, waitTime int, maxRetries int, insecure bool, caFile string, proxyURL string, proxyCreds string) (*V2, error)
NewV2 Constructor for V2 Client
defaultTimeout (in seconds) e.g. NewV2("https://pce.my-company.com:8443", 1, "api_xxxxxx", "big-secret", 30, rate.NewLimiter(rate.Limit(float64(125)/float64(60)), 1), 10, 3, false, "", "")
func (*V2) AsyncGet ¶
func (c *V2) AsyncGet(endpoint string, queryParams *map[string]string) (*http.Response, *gabs.Container, error)
AsyncGet Performs HTTP GET on endpoint with queryParams and polls until data is ready
Illumio GET APIs return json response on success, available as *gabs.Container
func (*V2) Create ¶
Create Performs HTTP POST on endpoint with model
Illumio POST APIs return json response on success, available as *gabs.Container
func (*V2) Delete ¶
Delete Performs HTTP DELETE on endpoint
Illumio DELETE APIs does not return any response
func (*V2) Get ¶
func (c *V2) Get(endpoint string, queryParams *map[string]string) (*http.Response, *gabs.Container, error)
Get Performs HTTP GET on endpoint with queryParams
Illumio GET APIs return json response on success, available as *gabs.Container
func (*V2) PrepareModel ¶
PrepareModel Creates container from model