Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
4092 lines (3508 sloc) 158 KB
/* Copyright © 2017 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: BSD-2-Clause
Generated by: https://github.com/swagger-api/swagger-codegen.git */
package nsxt
import (
"context"
"encoding/json"
"fmt"
"github.com/vmware/go-vmware-nsxt/manager"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type GroupingObjectsApiService service
/* GroupingObjectsApiService Add a MAC address to a MACSet
Add an individual MAC address to a MACSet
* @param ctx context.Context Authentication Context
@param macSetId MAC Set Id
@param mACAddressElement
@return manager.MacAddressElement*/
func (a *GroupingObjectsApiService) AddMACAddress(ctx context.Context, macSetId string, mACAddressElement manager.MacAddressElement) (manager.MacAddressElement, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.MacAddressElement
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/mac-sets/{mac-set-id}/members"
localVarPath = strings.Replace(localVarPath, "{"+"mac-set-id"+"}", fmt.Sprintf("%v", macSetId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &mACAddressElement
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Add NSGroup expression
Add/remove the expressions passed in the request body to/from the NSGroup
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param nSGroupExpressionList
@param action Specifies addition or removal action
@return NsGroup*/
func (a *GroupingObjectsApiService) AddOrRemoveNSGroupExpression(ctx context.Context, nsGroupId string, nSGroupExpressionList manager.NsGroupExpressionList, action string) (manager.NsGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("action", parameterToString(action, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSGroupExpressionList
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Add NSGroup expression
Add/remove the expressions passed in the request body to/from the NSGroup
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param nSGroupExpressionList
@param action Specifies addition or removal action
@return NsGroup*/
func (a *GroupingObjectsApiService) AddOrRemoveNsGroupTagExpression(ctx context.Context, nsGroupId string, nSGroupExpressionList manager.NsGroupTagExpressionList, action string) (manager.NsGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("action", parameterToString(action, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSGroupExpressionList
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Add NSGroup expression
Add/remove the expressions passed in the request body to/from the NSGroup
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param nSGroupExpressionList
@param action Specifies addition or removal action
@return NsGroup*/
func (a *GroupingObjectsApiService) AddOrRemoveNsGroupSimpleExpression(ctx context.Context, nsGroupId string, nSGroupExpressionList manager.NsGroupSimpleExpressionList, action string) (manager.NsGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("action", parameterToString(action, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSGroupExpressionList
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create IPSet
Creates a new IPSet that can group either IPv4 or IPv6 individual ip addresses, ranges or subnets.
* @param ctx context.Context Authentication Context
@param iPSet
@return manager.IpSet*/
func (a *GroupingObjectsApiService) CreateIPSet(ctx context.Context, iPSet manager.IpSet) (manager.IpSet, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IpSet
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ip-sets"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &iPSet
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create MACSet
Creates a new MACSet that can group individual MAC addresses.
* @param ctx context.Context Authentication Context
@param mACSet
@return manager.MacSet*/
func (a *GroupingObjectsApiService) CreateMACSet(ctx context.Context, mACSet manager.MacSet) (manager.MacSet, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.MacSet
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/mac-sets"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &mACSet
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create NSGroup
Creates a new NSGroup that can group NSX resources - VIFs, Lports and LSwitches as well as the grouping objects - IPSet, MACSet and other NSGroups
* @param ctx context.Context Authentication Context
@param nSGroup
@return NsGroup*/
func (a *GroupingObjectsApiService) CreateNSGroup(ctx context.Context, nSGroup manager.NsGroup) (manager.NsGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSGroup
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create NSService
Creates a new NSService which allows users to specify characteristics to use for matching network traffic.
* @param ctx context.Context Authentication Context
@param nSService
@return manager.NsService*/
func (a *GroupingObjectsApiService) CreateNSService(ctx context.Context, nSService manager.NsService) (manager.NsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSService
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create L4PortSetNSService
Creates a new NSService which allows users to specify characteristics to use for matching network traffic.
* @param ctx context.Context Authentication Context
@param nSService
@return manager.NsService*/
func (a *GroupingObjectsApiService) CreateL4PortSetNSService(ctx context.Context, nSService manager.L4PortSetNsService) (manager.L4PortSetNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.L4PortSetNsService
)
// set resource type for this type-specific API
nSService.ResourceType = "L4PortSetNSService"
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSService
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create IcmpTypeNSService
Creates a new NSService which allows users to specify characteristics to use for matching network traffic.
* @param ctx context.Context Authentication Context
@param nSService
@return manager.NsService*/
func (a *GroupingObjectsApiService) CreateIcmpTypeNSService(ctx context.Context, nSService manager.IcmpTypeNsService) (manager.IcmpTypeNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IcmpTypeNsService
)
// set resource type for this type-specific API
nSService.ResourceType = "ICMPTypeNSService"
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSService
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create IgmpTypeNSService
Creates a new NSService which allows users to specify characteristics to use for matching network traffic.
* @param ctx context.Context Authentication Context
@param nSService
@return manager.NsService*/
func (a *GroupingObjectsApiService) CreateIgmpTypeNSService(ctx context.Context, nSService manager.IgmpTypeNsService) (manager.IgmpTypeNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IgmpTypeNsService
)
// set resource type for this type-specific API
nSService.ResourceType = "IGMPTypeNSService"
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSService
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create AlgTypeNSService
Creates a new NSService which allows users to specify characteristics to use for matching network traffic.
* @param ctx context.Context Authentication Context
@param nSService
@return manager.NsService*/
func (a *GroupingObjectsApiService) CreateAlgTypeNSService(ctx context.Context, nSService manager.AlgTypeNsService) (manager.AlgTypeNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.AlgTypeNsService
)
// set resource type for this type-specific API
nSService.ResourceType = "ALGTypeNSService"
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSService
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create EtherTypeNSService
Creates a new NSService which allows users to specify characteristics to use for matching network traffic.
* @param ctx context.Context Authentication Context
@param nSService
@return manager.NsService*/
func (a *GroupingObjectsApiService) CreateEtherTypeNSService(ctx context.Context, nSService manager.EtherTypeNsService) (manager.EtherTypeNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.EtherTypeNsService
)
// set resource type for this type-specific API
nSService.ResourceType = "EtherTypeNSService"
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSService
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create IpProtocolNSService
Creates a new NSService which allows users to specify characteristics to use for matching network traffic.
* @param ctx context.Context Authentication Context
@param nSService
@return manager.NsService*/
func (a *GroupingObjectsApiService) CreateIpProtocolNSService(ctx context.Context, nSService manager.IpProtocolNsService) (manager.IpProtocolNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IpProtocolNsService
)
// set resource type for this type-specific API
nSService.ResourceType = "IPProtocolNSService"
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSService
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Create NSServiceGroup
Creates a new NSServiceGroup which can contain NSServices. A given NSServiceGroup can contain either only ether type of NSServices or only non-ether type of NSServices, i.e. an NSServiceGroup cannot contain a mix of both ether and non-ether types of NSServices.
* @param ctx context.Context Authentication Context
@param nSServiceGroup
@return manager.NsServiceGroup*/
func (a *GroupingObjectsApiService) CreateNSServiceGroup(ctx context.Context, nSServiceGroup manager.NsServiceGroup) (manager.NsServiceGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsServiceGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-service-groups"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &nSServiceGroup
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Delete IPSet
Deletes the specified IPSet. By default, if the IPSet is added to an NSGroup, it won't be deleted. In such situations, pass \"force=true\" as query param to force delete the IPSet.
* @param ctx context.Context Authentication Context
@param ipSetId IPSet Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "force" (bool) Force delete the resource even if it is being used somewhere
@return */
func (a *GroupingObjectsApiService) DeleteIPSet(ctx context.Context, ipSetId string, localVarOptionals map[string]interface{}) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ip-sets/{ip-set-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ip-set-id"+"}", fmt.Sprintf("%v", ipSetId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["force"], "bool", "force"); err != nil {
return nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["force"].(bool); localVarOk {
localVarQueryParams.Add("force", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* GroupingObjectsApiService Delete MACSet
Deletes the specified MACSet. By default, if the MACSet is added to an NSGroup, it won't be deleted. In such situations, pass \"force=true\" as query param to force delete the MACSet.
* @param ctx context.Context Authentication Context
@param macSetId MACSet Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "force" (bool) Force delete the resource even if it is being used somewhere
@return */
func (a *GroupingObjectsApiService) DeleteMACSet(ctx context.Context, macSetId string, localVarOptionals map[string]interface{}) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/mac-sets/{mac-set-id}"
localVarPath = strings.Replace(localVarPath, "{"+"mac-set-id"+"}", fmt.Sprintf("%v", macSetId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["force"], "bool", "force"); err != nil {
return nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["force"].(bool); localVarOk {
localVarQueryParams.Add("force", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* GroupingObjectsApiService Delete NSGroup
Deletes the specified NSGroup. By default, if the NSGroup is added to another NSGroup, it won't be deleted. In such situations, pass \"force=true\" as query param to force delete the NSGroup.
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "force" (bool) Force delete the resource even if it is being used somewhere
@return */
func (a *GroupingObjectsApiService) DeleteNSGroup(ctx context.Context, nsGroupId string, localVarOptionals map[string]interface{}) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["force"], "bool", "force"); err != nil {
return nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["force"].(bool); localVarOk {
localVarQueryParams.Add("force", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* GroupingObjectsApiService Delete NSService
Deletes the specified NSService. By default, if the NSService is being referred in an NSServiceGroup, it can't be deleted. In such situations, pass \"force=true\" as a parameter to force delete the NSService. System defined NSServices can't be deleted using \"force\" flag.
* @param ctx context.Context Authentication Context
@param nsServiceId NSService Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "force" (bool) Force delete the resource even if it is being used somewhere
@return */
func (a *GroupingObjectsApiService) DeleteNSService(ctx context.Context, nsServiceId string, localVarOptionals map[string]interface{}) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services/{ns-service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-id"+"}", fmt.Sprintf("%v", nsServiceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["force"], "bool", "force"); err != nil {
return nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["force"].(bool); localVarOk {
localVarQueryParams.Add("force", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* GroupingObjectsApiService Delete NSServiceGroup
Deletes the specified NSServiceGroup. By default, if the NSServiceGroup is consumed in a Firewall rule, it won't get deleted. In such situations, pass \"force=true\" as query param to force delete the NSServiceGroup.
* @param ctx context.Context Authentication Context
@param nsServiceGroupId NSServiceGroup Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "force" (bool) Force delete the resource even if it is being used somewhere
@return */
func (a *GroupingObjectsApiService) DeleteNSServiceGroup(ctx context.Context, nsServiceGroupId string, localVarOptionals map[string]interface{}) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-service-groups/{ns-service-group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-group-id"+"}", fmt.Sprintf("%v", nsServiceGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["force"], "bool", "force"); err != nil {
return nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["force"].(bool); localVarOk {
localVarQueryParams.Add("force", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* GroupingObjectsApiService Get Effective IPAddress translated from the NSGroup
Returns effective ip address members of the specified NSGroup.
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.EffectiveIpAddressMemberListResult*/
func (a *GroupingObjectsApiService) GetEffectiveIPAddressMembers(ctx context.Context, nsGroupId string, localVarOptionals map[string]interface{}) (manager.EffectiveIpAddressMemberListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.EffectiveIpAddressMemberListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}/effective-ip-address-members"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Get Effective Logical Ports translated from the NSgroup
Returns effective logical port members of the specified NSGroup.
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.EffectiveMemberResourceListResult*/
func (a *GroupingObjectsApiService) GetEffectiveLogicalPortMembers(ctx context.Context, nsGroupId string, localVarOptionals map[string]interface{}) (manager.EffectiveMemberResourceListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.EffectiveMemberResourceListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}/effective-logical-port-members"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Get Effective switch members translated from the NSGroup
Returns effective logical switch members of the specified NSGroup.
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.EffectiveMemberResourceListResult*/
func (a *GroupingObjectsApiService) GetEffectiveLogicalSwitchMembers(ctx context.Context, nsGroupId string, localVarOptionals map[string]interface{}) (manager.EffectiveMemberResourceListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.EffectiveMemberResourceListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}/effective-logical-switch-members"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Get Effective Virtual Machine members of the specified NSGroup.
Returns effective virtual machine members of the specified NSGroup.
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.VirtualMachineListResult*/
func (a *GroupingObjectsApiService) GetEffectiveVirtualMachineMembers(ctx context.Context, nsGroupId string, localVarOptionals map[string]interface{}) (manager.VirtualMachineListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.VirtualMachineListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}/effective-virtual-machine-members"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Get all MACAddresses in a MACSet
List all MAC addresses in a MACSet
* @param ctx context.Context Authentication Context
@param macSetId MAC Set Id
@return manager.MacAddressElementListResult*/
func (a *GroupingObjectsApiService) GetMACAddresses(ctx context.Context, macSetId string) (manager.MacAddressElementListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.MacAddressElementListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/mac-sets/{mac-set-id}/members"
localVarPath = strings.Replace(localVarPath, "{"+"mac-set-id"+"}", fmt.Sprintf("%v", macSetId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Get member types from NSGroup
Returns member types for a specified NSGroup including child NSGroups. This considers static members and members added via membership criteria only
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.EffectiveMemberTypeListResult*/
func (a *GroupingObjectsApiService) GetMemberTypes(ctx context.Context, nsGroupId string, localVarOptionals map[string]interface{}) (manager.EffectiveMemberTypeListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.EffectiveMemberTypeListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}/member-types"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Get services to which the given nsgroup belongs to
Returns information about services that are associated with the given NSGroup. The service name is passed by service_type parameter
* @param ctx context.Context Authentication Context
@param nsgroupId
@param serviceType
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "fetchParentgroupAssociations" (bool) Fetch complete list of associated resources considering nesting
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.ServiceAssociationListResult*/
func (a *GroupingObjectsApiService) GetServiceAssociations(ctx context.Context, nsgroupId string, serviceType string, localVarOptionals map[string]interface{}) (manager.ServiceAssociationListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.ServiceAssociationListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{nsgroup-id}/service-associations"
localVarPath = strings.Replace(localVarPath, "{"+"nsgroup-id"+"}", fmt.Sprintf("%v", nsgroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fetchParentgroupAssociations"], "bool", "fetchParentgroupAssociations"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fetchParentgroupAssociations"].(bool); localVarOk {
localVarQueryParams.Add("fetch_parentgroup_associations", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
localVarQueryParams.Add("service_type", parameterToString(serviceType, ""))
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Get the list of all the virtual machines that are not a part of any existing NSGroup.
Get the list of all the virtual machines that are not a part of any existing NSGroup.
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "displayName" (string) Display Name of the virtual machine
@param "externalId" (string) External id of the virtual machine
@param "hostId" (string) Id of the host where this vif is located
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.UnassociatedVmListResult*/
func (a *GroupingObjectsApiService) GetUnassociatedVirtualMachines(ctx context.Context, localVarOptionals map[string]interface{}) (manager.UnassociatedVmListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.UnassociatedVmListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/unassociated-virtual-machines"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["displayName"], "string", "displayName"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["externalId"], "string", "externalId"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["hostId"], "string", "hostId"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["displayName"].(string); localVarOk {
localVarQueryParams.Add("display_name", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["externalId"].(string); localVarOk {
localVarQueryParams.Add("external_id", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["hostId"].(string); localVarOk {
localVarQueryParams.Add("host_id", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService List IPSets
Returns paginated list of IPSets
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.IpSetListResult*/
func (a *GroupingObjectsApiService) ListIPSets(ctx context.Context, localVarOptionals map[string]interface{}) (manager.IpSetListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IpSetListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ip-sets"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService List MACSets
Returns paginated list of MACSets
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.MacSetListResult*/
func (a *GroupingObjectsApiService) ListMACSets(ctx context.Context, localVarOptionals map[string]interface{}) (manager.MacSetListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.MacSetListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/mac-sets"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService List NSGroups
List the NSGroups in a paginated format. The page size is restricted to 50 NSGroups so that the size of the response remains small even in the worst case. Optionally, specify valid member types as request parameter to filter NSGroups.
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "memberTypes" (string) Specify member types to filter corresponding NSGroups
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "populateReferences" (bool) Populate metadata of resource referenced by NSGroupExpressions
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.NsGroupListResult*/
func (a *GroupingObjectsApiService) ListNSGroups(ctx context.Context, localVarOptionals map[string]interface{}) (manager.NsGroupListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsGroupListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["memberTypes"], "string", "memberTypes"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["populateReferences"], "bool", "populateReferences"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["memberTypes"].(string); localVarOk {
localVarQueryParams.Add("member_types", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["populateReferences"].(bool); localVarOk {
localVarQueryParams.Add("populate_references", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService List all NSServiceGroups
Returns paginated list of NSServiceGroups
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "defaultService" (bool) Fetch all default NSServiceGroups
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.NsServiceGroupListResult*/
func (a *GroupingObjectsApiService) ListNSServiceGroups(ctx context.Context, localVarOptionals map[string]interface{}) (manager.NsServiceGroupListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsServiceGroupListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-service-groups"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["defaultService"], "bool", "defaultService"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["defaultService"].(bool); localVarOk {
localVarQueryParams.Add("default_service", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService List all NSServices
Returns paginated list of NSServices
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "defaultService" (bool) Fetch all default NSServices
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return manager.NsServiceListResult*/
func (a *GroupingObjectsApiService) ListNSServices(ctx context.Context, localVarOptionals map[string]interface{}) (manager.NsServiceListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsServiceListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["defaultService"], "bool", "defaultService"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["defaultService"].(bool); localVarOk {
localVarQueryParams.Add("default_service", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read IPSet
Returns information about the specified IPSet
* @param ctx context.Context Authentication Context
@param ipSetId IPSet Id
@return manager.IpSet*/
func (a *GroupingObjectsApiService) ReadIPSet(ctx context.Context, ipSetId string) (manager.IpSet, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IpSet
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ip-sets/{ip-set-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ip-set-id"+"}", fmt.Sprintf("%v", ipSetId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read MACSet
Returns information about the specified MACSet
* @param ctx context.Context Authentication Context
@param macSetId MACSet Id
@return manager.MacSet*/
func (a *GroupingObjectsApiService) ReadMACSet(ctx context.Context, macSetId string) (manager.MacSet, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.MacSet
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/mac-sets/{mac-set-id}"
localVarPath = strings.Replace(localVarPath, "{"+"mac-set-id"+"}", fmt.Sprintf("%v", macSetId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read NSGroup
Returns information about the specified NSGroup.
* @param ctx context.Context Authentication Context
@param nsGroupId NSGroup Id
@param optional (nil or map[string]interface{}) with one or more of:
@param "populateReferences" (bool) Populate metadata of resource referenced by NSGroupExpressions
@return NsGroup*/
func (a *GroupingObjectsApiService) ReadNSGroup(ctx context.Context, nsGroupId string, localVarOptionals map[string]interface{}) (manager.NsGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-groups/{ns-group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-group-id"+"}", fmt.Sprintf("%v", nsGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["populateReferences"], "bool", "populateReferences"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["populateReferences"].(bool); localVarOk {
localVarQueryParams.Add("populate_references", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read NSService
Returns information about the specified NSService
* @param ctx context.Context Authentication Context
@param nsServiceId NSService Id
@return manager.NsService*/
func (a *GroupingObjectsApiService) ReadNSService(ctx context.Context, nsServiceId string) (manager.NsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services/{ns-service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-id"+"}", fmt.Sprintf("%v", nsServiceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read L4PortSetNSService
Returns information about the specified L4PortSetNSService
* @param ctx context.Context Authentication Context
@param nsServiceId NSService Id
@return manager.L4PortSetNsService*/
func (a *GroupingObjectsApiService) ReadL4PortSetNSService(ctx context.Context, nsServiceId string) (manager.L4PortSetNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.L4PortSetNsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services/{ns-service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-id"+"}", fmt.Sprintf("%v", nsServiceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read IcmpTypeNSService
Returns information about the specified IcmpTypeNSService
* @param ctx context.Context Authentication Context
@param nsServiceId NSService Id
@return manager.IcmpTypeNsService*/
func (a *GroupingObjectsApiService) ReadIcmpTypeNSService(ctx context.Context, nsServiceId string) (manager.IcmpTypeNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IcmpTypeNsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services/{ns-service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-id"+"}", fmt.Sprintf("%v", nsServiceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read IgmpTypeNSService
Returns information about the specified IgmpTypeNSService
* @param ctx context.Context Authentication Context
@param nsServiceId NSService Id
@return manager.IgmpTypeNsService*/
func (a *GroupingObjectsApiService) ReadIgmpTypeNSService(ctx context.Context, nsServiceId string) (manager.IgmpTypeNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IgmpTypeNsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services/{ns-service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-id"+"}", fmt.Sprintf("%v", nsServiceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read AlgTypeNSService
Returns information about the specified AlgTypeNSService
* @param ctx context.Context Authentication Context
@param nsServiceId NSService Id
@return manager.AlgTypeNsService*/
func (a *GroupingObjectsApiService) ReadAlgTypeNSService(ctx context.Context, nsServiceId string) (manager.AlgTypeNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.AlgTypeNsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services/{ns-service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-id"+"}", fmt.Sprintf("%v", nsServiceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read EtherTypeNSService
Returns information about the specified EtherTypeNSService
* @param ctx context.Context Authentication Context
@param nsServiceId NSService Id
@return manager.EtherTypeNsService*/
func (a *GroupingObjectsApiService) ReadEtherTypeNSService(ctx context.Context, nsServiceId string) (manager.EtherTypeNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.EtherTypeNsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services/{ns-service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-id"+"}", fmt.Sprintf("%v", nsServiceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read IpProtocolNSService
Returns information about the specified IpProtocolNSService
* @param ctx context.Context Authentication Context
@param nsServiceId NSService Id
@return manager.IpProtocolNsService*/
func (a *GroupingObjectsApiService) ReadIpProtocolNSService(ctx context.Context, nsServiceId string) (manager.IpProtocolNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.IpProtocolNsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-services/{ns-service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-id"+"}", fmt.Sprintf("%v", nsServiceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Read NSServiceGroup
Returns information about the specified NSServiceGroup
* @param ctx context.Context Authentication Context
@param nsServiceGroupId NSServiceGroup Id
@return manager.NsServiceGroup*/
func (a *GroupingObjectsApiService) ReadNSServiceGroup(ctx context.Context, nsServiceGroupId string) (manager.NsServiceGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload manager.NsServiceGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/ns-service-groups/{ns-service-group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"ns-service-group-id"+"}", fmt.Sprintf("%v", nsServiceGroupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* GroupingObjectsApiService Remove a MAC address from given MACSet
Remove an individual MAC address from a MACSet
* @param ctx context.Context Authentication Context
@param macSetId MACSet Id
@param macAddress MAC address to be removed
@return */
func (a *GroupingObjectsApiService) RemoveMACAddress(ctx context.Context, macSetId string, macAddress string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/mac-sets/{mac-set-id}/members/{mac-address}"
localVarPath = strings.Replace(localVarPath, "{"+"mac-set-id"+"}", fmt.Sprintf("%v", macSetId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"mac-address"+"}", fmt.Sprintf("%v", macAddress), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams[