Documentation ¶
Index ¶
- Constants
- Variables
- type APIDocData
- func (a *APIDocData) AddSecurityPolicies(policy string)
- func (a *APIDocData) GetAPIKeyInfo() []apic.APIKeyInfo
- func (a *APIDocData) GetPortalTitle() string
- func (a *APIDocData) GetSecurityPolicies() []string
- func (a *APIDocData) HasAPIKey() bool
- func (a *APIDocData) HasOauth() bool
- func (a *APIDocData) SetAPIKeyInfo(keyInfo []apic.APIKeyInfo)
- func (a *APIDocData) SetPortalTitle(title string)
- func (a *APIDocData) SetSecurityPolicies(policies []string)
- type APIDocDataResponse
- type ApigeeClient
- func (a *ApigeeClient) AddCredentialProduct(appName, devID, key string, cpr CredentialProvisionRequest) (*models.DeveloperAppCredentials, error)
- func (a *ApigeeClient) CreateAPIProduct(product *models.ApiProduct) (*models.ApiProduct, error)
- func (a *ApigeeClient) CreateAppCredential(appName, devID string, products []string, expDays int) (*models.DeveloperApp, error)
- func (a *ApigeeClient) CreateDeveloperApp(newApp models.DeveloperApp) (*models.DeveloperApp, error)
- func (a *ApigeeClient) CreateSharedFlow(data []byte, name string) error
- func (a *ApigeeClient) DeploySharedFlow(env, name, revision string) error
- func (a *ApigeeClient) GetAllEnvironmentVirtualHosts(envName string) ([]*models.VirtualHost, error)
- func (a *ApigeeClient) GetAllProxies() (Proxies, error)
- func (a *ApigeeClient) GetAllSpecs() ([]SpecDetails, error)
- func (a *ApigeeClient) GetAppCredential(appName, devID, key string) (*models.DeveloperAppCredentials, error)
- func (a *ApigeeClient) GetConfig() *config.ApigeeConfig
- func (a *ApigeeClient) GetDeployments(proxyName string) (*models.DeploymentDetails, error)
- func (a *ApigeeClient) GetDeveloperApp(name string) (*models.DeveloperApp, error)
- func (a *ApigeeClient) GetDeveloperID() string
- func (a *ApigeeClient) GetEnvironments() []string
- func (a *ApigeeClient) GetProduct(productName string) (*models.ApiProduct, error)
- func (a *ApigeeClient) GetProducts() (Products, error)
- func (a *ApigeeClient) GetProxy(proxyName string) (*models.ApiProxy, error)
- func (a *ApigeeClient) GetRevision(proxyName, revision string) (*models.ApiProxyRevision, error)
- func (a *ApigeeClient) GetRevisionConnectionType(proxyName, revision string) (*HTTPProxyConnection, error)
- func (a *ApigeeClient) GetRevisionPolicyByName(proxyName, revision, policyName string) (*PolicyDetail, error)
- func (a *ApigeeClient) GetRevisionResourceFile(proxyName, revision, resourceType, resourceName string) ([]byte, error)
- func (a *ApigeeClient) GetRevisionSpec(apiName, revisionNumber, specFile string) []byte
- func (a *ApigeeClient) GetSharedFlow(name string) (*models.SharedFlowRevisionDeploymentDetails, error)
- func (a *ApigeeClient) GetSpecFile(specPath string) ([]byte, error)
- func (a *ApigeeClient) GetSpecFromURL(url string, options ...RequestOption) ([]byte, error)
- func (a *ApigeeClient) GetStats(env, dimension, metricSelect string, start, end time.Time) (*models.Metrics, error)
- func (a *ApigeeClient) GetVirtualHost(envName, virtualHostName string) (*models.VirtualHost, error)
- func (a *ApigeeClient) IsReady() bool
- func (a *ApigeeClient) PublishSharedFlowToEnvironment(env, name string) error
- func (a *ApigeeClient) RemoveAppCredential(appName, devID, key string) error
- func (a *ApigeeClient) RemoveCredentialProduct(appName, devID, key, productName string) error
- func (a *ApigeeClient) RemoveDeveloperApp(appName, developerID string) error
- func (a *ApigeeClient) UpdateAppCredential(appName, devID, key string, enable bool) error
- func (a *ApigeeClient) UpdateCredentialProduct(appName, devID, key, productName string, enable bool) error
- func (a *ApigeeClient) UpdateDeveloperApp(app models.DeveloperApp) (*models.DeveloperApp, error)
- type AuthResponse
- type CredentialProvisionRequest
- type HTTPProxyConnection
- type PolicyDetail
- type PortalData
- type PortalResponse
- type PortalsResponse
- type Products
- type Proxies
- type RequestOption
- func WithBody(body []byte) RequestOption
- func WithDefaultHeaders() RequestOption
- func WithHeader(name, value string) RequestOption
- func WithHeaders(headers map[string]string) RequestOption
- func WithQueryParam(name, value string) RequestOption
- func WithQueryParams(queryParams map[string]string) RequestOption
- func WithStringBody(body string) RequestOption
- type SpecDetails
- type VirtualHosts
Constants ¶
const (
ClonedProdAttribute = "ClonedProduct"
)
Variables ¶
var ApigeeAgentAttribute = models.Attribute{
Name: "createdBy",
Value: "apigee-agent",
}
Functions ¶
This section is empty.
Types ¶
type APIDocData ¶
type APIDocData struct { ID int `json:"id"` PortalID string `json:"siteId"` Title string `json:"title"` Description string `json:"description"` APIID string `json:"apiId"` ProductName string `json:"edgeAPIProductName"` SpecContent string `json:"specContent"` SpecTitle string `json:"specTitle"` SpecID string `json:"specId"` ProductExists bool `json:"productExists"` Modified int `json:"modified"` SnapshotModified int `json:"snapshotModified"` ImageURL *string `json:"imageUrl"` CategoryIds []int `json:"categoryIds"` Visibility bool `json:"visibility"` // contains filtered or unexported fields }
APIDocData - the data returned from teh call to get portal apis
func (*APIDocData) AddSecurityPolicies ¶
func (a *APIDocData) AddSecurityPolicies(policy string)
AddSecurityPolicies - add the security policy to the security policies slice in the api doc data
func (*APIDocData) GetAPIKeyInfo ¶
func (a *APIDocData) GetAPIKeyInfo() []apic.APIKeyInfo
GetAPIKeyInfo - get the api key info needed to access this api
func (*APIDocData) GetPortalTitle ¶
func (a *APIDocData) GetPortalTitle() string
GetPortalTitle - get the portal title of the api doc data
func (*APIDocData) GetSecurityPolicies ¶
func (a *APIDocData) GetSecurityPolicies() []string
GetSecurityPolicies - get the security policies of the api doc data
func (*APIDocData) HasAPIKey ¶
func (a *APIDocData) HasAPIKey() bool
HasAPIKey - returns if the api has api key authentication
func (*APIDocData) HasOauth ¶
func (a *APIDocData) HasOauth() bool
HasOauth - returns if the api has oauth authentication
func (*APIDocData) SetAPIKeyInfo ¶
func (a *APIDocData) SetAPIKeyInfo(keyInfo []apic.APIKeyInfo)
SetAPIKeyInfo - set the api key info needed to access this api
func (*APIDocData) SetPortalTitle ¶
func (a *APIDocData) SetPortalTitle(title string)
SetPortalTitle - set the portal title in the api doc data
func (*APIDocData) SetSecurityPolicies ¶
func (a *APIDocData) SetSecurityPolicies(policies []string)
SetSecurityPolicies - set the security policies in the api doc data
type APIDocDataResponse ¶
type APIDocDataResponse struct { Status string `json:"status"` Message string `json:"message"` Code string `json:"code"` ErrorCode string `json:"error_code"` RequestID string `json:"request_id"` Data []*APIDocData `json:"data"` }
APIDocDataResponse -
type ApigeeClient ¶
type ApigeeClient struct {
// contains filtered or unexported fields
}
ApigeeClient - Represents the Gateway client
func NewClient ¶
func NewClient(apigeeCfg *config.ApigeeConfig) (*ApigeeClient, error)
NewClient - Creates a new Gateway Client
func (*ApigeeClient) AddCredentialProduct ¶
func (a *ApigeeClient) AddCredentialProduct(appName, devID, key string, cpr CredentialProvisionRequest) (*models.DeveloperAppCredentials, error)
func (*ApigeeClient) CreateAPIProduct ¶
func (a *ApigeeClient) CreateAPIProduct(product *models.ApiProduct) (*models.ApiProduct, error)
func (*ApigeeClient) CreateAppCredential ¶
func (a *ApigeeClient) CreateAppCredential(appName, devID string, products []string, expDays int) (*models.DeveloperApp, error)
func (*ApigeeClient) CreateDeveloperApp ¶
func (a *ApigeeClient) CreateDeveloperApp(newApp models.DeveloperApp) (*models.DeveloperApp, error)
CreateDeveloperApp - create an app for the developer
func (*ApigeeClient) CreateSharedFlow ¶
func (a *ApigeeClient) CreateSharedFlow(data []byte, name string) error
CreateSharedFlow - uploads an apigee bundle as a shared flow
func (*ApigeeClient) DeploySharedFlow ¶
func (a *ApigeeClient) DeploySharedFlow(env, name, revision string) error
DeploySharedFlow - deploy the shared flow and revision to the environment
func (*ApigeeClient) GetAllEnvironmentVirtualHosts ¶
func (a *ApigeeClient) GetAllEnvironmentVirtualHosts(envName string) ([]*models.VirtualHost, error)
GetAllVirtualHosts - returns an array of all virtual hosts defined
func (*ApigeeClient) GetAllProxies ¶
func (a *ApigeeClient) GetAllProxies() (Proxies, error)
GetAllProxies - get all proxies
func (*ApigeeClient) GetAllSpecs ¶
func (a *ApigeeClient) GetAllSpecs() ([]SpecDetails, error)
GetAllSpecs - downloads the specfile from apigee given the path of its location
func (*ApigeeClient) GetAppCredential ¶
func (a *ApigeeClient) GetAppCredential(appName, devID, key string) (*models.DeveloperAppCredentials, error)
func (*ApigeeClient) GetConfig ¶
func (a *ApigeeClient) GetConfig() *config.ApigeeConfig
GetConfig - return the apigee client config
func (*ApigeeClient) GetDeployments ¶
func (a *ApigeeClient) GetDeployments(proxyName string) (*models.DeploymentDetails, error)
GetDeployments - get a deployments for a proxy
func (*ApigeeClient) GetDeveloperApp ¶
func (a *ApigeeClient) GetDeveloperApp(name string) (*models.DeveloperApp, error)
GetDeveloperApp gets an app by name
func (*ApigeeClient) GetDeveloperID ¶
func (a *ApigeeClient) GetDeveloperID() string
GetDeveloperID - get the developer id to be used when creating apps
func (*ApigeeClient) GetEnvironments ¶
func (a *ApigeeClient) GetEnvironments() []string
GetEnvironments - get the list of environments for the org
func (*ApigeeClient) GetProduct ¶
func (a *ApigeeClient) GetProduct(productName string) (*models.ApiProduct, error)
GetProduct - get details of the product
func (*ApigeeClient) GetProducts ¶
func (a *ApigeeClient) GetProducts() (Products, error)
GetProducts - get the list of products for the org
func (*ApigeeClient) GetProxy ¶
func (a *ApigeeClient) GetProxy(proxyName string) (*models.ApiProxy, error)
GetProxy - get a proxy with a name
func (*ApigeeClient) GetRevision ¶
func (a *ApigeeClient) GetRevision(proxyName, revision string) (*models.ApiProxyRevision, error)
GetRevision - get a revision of a proxy with a name
func (*ApigeeClient) GetRevisionConnectionType ¶
func (a *ApigeeClient) GetRevisionConnectionType(proxyName, revision string) (*HTTPProxyConnection, error)
GetRevisionConnectionType - get a revision bundle and open the proxy config file
func (*ApigeeClient) GetRevisionPolicyByName ¶
func (a *ApigeeClient) GetRevisionPolicyByName(proxyName, revision, policyName string) (*PolicyDetail, error)
GetRevisionPolicyByName - get the details about a named policy on a revision
func (*ApigeeClient) GetRevisionResourceFile ¶
func (a *ApigeeClient) GetRevisionResourceFile(proxyName, revision, resourceType, resourceName string) ([]byte, error)
GetProxy - get a proxy with a name
func (*ApigeeClient) GetRevisionSpec ¶
func (a *ApigeeClient) GetRevisionSpec(apiName, revisionNumber, specFile string) []byte
GetRevisionSpec - gets the resource file of type openapi for the org, api, revision, and spec file specified
func (*ApigeeClient) GetSharedFlow ¶
func (a *ApigeeClient) GetSharedFlow(name string) (*models.SharedFlowRevisionDeploymentDetails, error)
GetSharedFlow - gets the list of shared flows
func (*ApigeeClient) GetSpecFile ¶
func (a *ApigeeClient) GetSpecFile(specPath string) ([]byte, error)
GetSpecFile - downloads the specfile from apigee given the path of its location
func (*ApigeeClient) GetSpecFromURL ¶
func (a *ApigeeClient) GetSpecFromURL(url string, options ...RequestOption) ([]byte, error)
GetSpecFromURL - downloads the specfile from a URL outside of APIGEE
func (*ApigeeClient) GetStats ¶
func (a *ApigeeClient) GetStats(env, dimension, metricSelect string, start, end time.Time) (*models.Metrics, error)
GetStats - get the api stats for a specific environment
func (*ApigeeClient) GetVirtualHost ¶
func (a *ApigeeClient) GetVirtualHost(envName, virtualHostName string) (*models.VirtualHost, error)
GetAllVirtualHosts - returns an array of all virtual hosts defined
func (*ApigeeClient) IsReady ¶
func (a *ApigeeClient) IsReady() bool
IsReady - returns true when the apigee client authenticates
func (*ApigeeClient) PublishSharedFlowToEnvironment ¶
func (a *ApigeeClient) PublishSharedFlowToEnvironment(env, name string) error
PublishSharedFlowToEnvironment - publish the shared flow
func (*ApigeeClient) RemoveAppCredential ¶
func (a *ApigeeClient) RemoveAppCredential(appName, devID, key string) error
func (*ApigeeClient) RemoveCredentialProduct ¶
func (a *ApigeeClient) RemoveCredentialProduct(appName, devID, key, productName string) error
func (*ApigeeClient) RemoveDeveloperApp ¶
func (a *ApigeeClient) RemoveDeveloperApp(appName, developerID string) error
RemoveDeveloperApp - create an app for the developer
func (*ApigeeClient) UpdateAppCredential ¶
func (a *ApigeeClient) UpdateAppCredential(appName, devID, key string, enable bool) error
func (*ApigeeClient) UpdateCredentialProduct ¶
func (a *ApigeeClient) UpdateCredentialProduct(appName, devID, key, productName string, enable bool) error
func (*ApigeeClient) UpdateDeveloperApp ¶
func (a *ApigeeClient) UpdateDeveloperApp(app models.DeveloperApp) (*models.DeveloperApp, error)
UpdateDeveloperApp - update an app for the developer
type AuthResponse ¶
type AuthResponse struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` RefreshToken string `json:"refresh_token"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` JTI string `json:"jti"` }
AuthResponse - response struct from APIGEE auth call
type CredentialProvisionRequest ¶
type CredentialProvisionRequest struct { ApiProducts []string `json:"apiProducts"` Attributes []models.Attribute `json:"attributes,omitempty"` // The number of milliseconds the key will live KeyExpiresIn int `json:"keyExpiresIn,omitempty"` }
CredentialProvisionRequest represents the request body needed to add an api product to a credential in an app.
type HTTPProxyConnection ¶
type HTTPProxyConnection struct { XMLName xml.Name `xml:"HTTPProxyConnection"` BasePath string `xml:"BasePath"` VirtualHost string `xml:"VirtualHost"` }
HTTPProxyConnection
type PolicyDetail ¶
type PortalData ¶
type PortalData struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` CustomDomain string `json:"customDomain"` OrgName string `json:"orgName"` Status string `json:"status"` VisibleToCustomers bool `json:"visibleToCustomers"` HTTPS bool `json:"https"` DefaultDomain string `json:"defaultDomain"` CustomeDomainEnabled bool `json:"customDomainEnabled"` DefaultURL string `json:"defaultURL"` CurrentURL string `json:"currentURL"` CurrentDomain string `json:"currentDomain"` }
type PortalResponse ¶
type PortalResponse struct { Status string `json:"status"` Message string `json:"message"` Code string `json:"code"` ErrorCode string `json:"error_code"` RequestID string `json:"request_id"` Data PortalData `json:"data"` }
PortalResponse
type PortalsResponse ¶
type PortalsResponse struct { Status string `json:"status"` Message string `json:"message"` Code string `json:"code"` ErrorCode string `json:"error_code"` RequestID string `json:"request_id"` Data []PortalData `json:"data"` }
PortalsResponse
type RequestOption ¶
type RequestOption func(*apigeeRequest)
func WithDefaultHeaders ¶
func WithDefaultHeaders() RequestOption
WithDefaultHeaders - add the default headers needed for apigee
func WithHeader ¶
func WithHeader(name, value string) RequestOption
WithHeader - add an additional header to the request
func WithHeaders ¶
func WithHeaders(headers map[string]string) RequestOption
WithHeaders - add additional headers to the request
func WithQueryParam ¶
func WithQueryParam(name, value string) RequestOption
WithQueryParam - add a query parameter to the request
func WithQueryParams ¶
func WithQueryParams(queryParams map[string]string) RequestOption
WithQueryParams - add query parameters to the request
func WithStringBody ¶
func WithStringBody(body string) RequestOption
WithStringBody - add a JSON body, from a string, to the request
type SpecDetails ¶
type SpecDetails struct { ID string `json:"id"` Kind string `json:"kind"` Name string `json:"name"` Created string `json:"created"` Creator string `json:"creator"` Modified string `json:"modified"` IsTrashed bool `json:"isTrashed"` Permissions *string `json:"permissions"` SelfLink string `json:"self"` ContentLink string `json:"content"` Contents []SpecDetails `json:"contents"` FolderLink string `json:"folder"` FolderID string `json:"folderId"` Body *string `json:"body"` }