apigee

package
v0.2.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2020 License: Apache-2.0, BSD-3-Clause, MIT Imports: 22 Imported by: 0

Documentation

Overview

Package apigee provides a client for administering Apigee

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

func Int

func Int(v int) *int

Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it, but unlike Int32 its argument value is an int.

func IsInvalidOrExpired

func IsInvalidOrExpired(token *AuthToken) bool

func ReadTokenStash

func ReadTokenStash() (map[string]*AuthToken, error)

func StashToken

func StashToken(c *ApigeeClient, newToken *AuthToken) (map[string]*AuthToken, error)

func StreamToString

func StreamToString(stream io.Reader) string

StreamToString converts a reader to a string

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

Types

type AdminAuth

type AdminAuth struct {
	// Optional. The path to the .netrc file that holds credentials for the Edge Management server.
	// By default, this is ${HOME}/.netrc .  If you specify a Password, this option is ignored.
	NetrcPath string

	// Optional. The username to use when authenticating to the Edge Management server.
	// Ignored if you specify a NetrcPath.
	Username string

	// Optional. Used if you explicitly specify a Password.
	Password string

	// Optional. This gets populated with a token by the client
	Token string
}

AdminAuth holds information about how to authenticate to the Apigee Management server.

type ApiProduct

type ApiProduct struct {
	ApiResources   []string    `json:"apiResources,omitempty"`
	ApprovalType   string      `json:"approvalType,omitempty"`
	Attributes     []Attribute `json:"attributes,omitempty"`
	CreatedAt      Timestamp   `json:"createdAt,omitempty"`
	CreatedBy      string      `json:"createdBy,omitempty"`
	Description    string      `json:"description,omitempty"`
	DisplayName    string      `json:"displayName,omitempty"`
	Environments   []string    `json:"environments,omitempty"`
	LastModifiedAt Timestamp   `json:"lastModifiedAt,omitempty"`
	LastModifiedBy string      `json:"lastModifiedBy,omitempty"`
	Name           string      `json:"name,omitempty"`
	Proxies        []string    `json:"proxies,omitempty"`
	Quota          string      `json:"quota,omitempty"`
	QuotaInterval  string      `json:"quotaInterval,omitempty"`
	QuotaTimeUnit  string      `json:"quotaTimeUnit,omitempty"`
	Scopes         []string    `json:"scopes,omitempty"`
}

ApiProduct contains information about an API Product within an Edge organization.

type ApigeeClient

type ApigeeClient struct {

	// defaults to https://login.apigee.com
	LoginBaseUrl string

	// Base URL for API requests.
	BaseURL *url.URL

	// Optional. tells whether to try to obtain a token or not.
	WantToken bool

	// User agent for client
	UserAgent string

	// Services used for communicating with the API
	Caches                CachesService
	Companies             CompaniesService
	CompanyAppCredentials CompanyAppCredentialsService
	CompanyApps           CompanyAppsService
	DeveloperApps         DeveloperAppsService
	Developers            DevelopersService
	Environments          EnvironmentsService
	KeyValueMapEntries    KeyValueMapEntriesService
	KeyValueMaps          KeyValueMapsService
	Options               ApigeeClientOptions
	Organization          OrganizationService
	Products              ProductsService
	Proxies               ProxiesService
	SharedFlows           SharedFlowsService
	TargetServers         TargetServersService
	VirtualHosts          VirtualHostsService
	// contains filtered or unexported fields
}

ApigeeClient manages communication with Apigee V1 Admin API.

func NewApigeeClient

func NewApigeeClient(o *ApigeeClientOptions) (*ApigeeClient, error)

NewApigeeClient returns a new ApigeeClient.

func (*ApigeeClient) Do

func (c *ApigeeClient) Do(req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*ApigeeClient) NewDeployableRequest added in v0.2.7

func (c *ApigeeClient) NewDeployableRequest(method, urlStr string) (*http.Request, error)

NewRequest creates an API request using application/x-www-form-urlencoded header.

func (*ApigeeClient) NewRequest

func (c *ApigeeClient) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.

func (*ApigeeClient) OnRequestCompleted

func (c *ApigeeClient) OnRequestCompleted(rc RequestCompletionCallback)

sets the request completion callback for the API

type ApigeeClientOptions

type ApigeeClientOptions struct {

	// Optional. The Apigee Admin base URL. For example, if using OPDK this might be
	// http://192.168.10.56:8080 . It defaults to https://api.enterprise.apigee.com
	MgmtUrl string

	// defaults to https://login.apigee.com
	LoginBaseUrl string

	// Specify the Edge organization name.
	Org string

	// Required. Authentication information for the Apigee Management server.
	Auth *AdminAuth

	// Optional. Warning: if set to true, HTTP Basic Auth base64 blobs will appear in output.
	Debug bool

	// Optional. tells whether to try to obtain a token or not.
	WantToken bool
	// contains filtered or unexported fields
}

type ApigeeServer

type ApigeeServer struct {
	Status string   `json:"status,omitempty"`
	Type   []string `json:"type,omitempty"`
	Uuid   string   `json:"uUID,omitempty"`
}

When inquiring the deployment status of an API PRoxy revision, even implicitly as when performing a Deploy or Undeploy, the response includes the deployment status for each particular Edge Server in the environment. This struct deserializes that information. It will normally not be useful at all. In rare cases, it may be useful in helping to diagnose problems. For example, if there is a problem with a deployment change, as when a Message Processor is experiencing a problem and cannot undeploy, or more commonly, cannot deploy an API Proxy, this struct will hold relevant information.

type App

type App struct {
	ApigeeId string
}

This is just a placeholder

type Attribute

type Attribute struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

type AuthToken

type AuthToken struct {
	AccessToken  *string   `json:"access_token,omitempty"`
	Expires      int64     `json:"expires,omitempty"`
	ISO          *ISOTimes `json:"ISO,omitempty"`
	Id           *string   `json:"jti,omitempty"`
	IssuedAt     int64     `json:"issued_at,omitempty"`
	Lifetime     int64     `json:"expires_in,omitempty"`
	RefreshToken *string   `json:"refresh_token,omitempty"`
	Scope        *string   `json:"scope,omitempty"`
	TokenType    *string   `json:"token_type,omitempty"`
}

func CurrentToken

func CurrentToken(c *ApigeeClient) (*AuthToken, error)

func GetNewToken

func GetNewToken(c *ApigeeClient) (*AuthToken, error)

func GetToken

func GetToken(c *ApigeeClient) (*AuthToken, error)

type Cache

type Cache struct {
	Description         string      `json:"description,omitempty"`
	DiskSizeInMB        int         `json:"diskSizeInMB,omitempty"`
	Distributed         bool        `json:"distributed,omitempty"`
	Expiry              CacheExpiry `json:"expirySettings,omitempty"`
	InMemorySizeInKB    int         `json:"inMemorySizeInKB,omitempty"`
	MaxElementsInMemory int         `json:"maxElementsInMemory,omitempty"`
	MaxElementsOnDisk   int         `json:"maxElementsOnDisk,omitempty"`
	Name                string      `json:"name,omitempty"`
	OverflowToDisk      bool        `json:"overflowToDisk,omitempty"`
	Persistent          bool        `json:"persistent,omitempty"`
}

Cache contains information about a cache within an Edge organization.

type CacheExpiry

type CacheExpiry struct {
	ExpiryType  string
	ExpiryValue string
	ValuesNull  bool
}

CacheExpiry represents the expiry settings on a cache. This struct marshals and unmarshals between the json format Edge uses and a reasonably clear golang struct.

func (CacheExpiry) MarshalJSON

func (ce CacheExpiry) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. It marshals from the form used by Apigee Edge into a CacheExpiry struct. Eg,

{
  "expiryDate": { "value": "{mm-dd-yyyy}" },
  "valuesNull" : false
}

func (CacheExpiry) String

func (ce CacheExpiry) String() string

func (*CacheExpiry) UnmarshalJSON

func (ce *CacheExpiry) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. It unmarshals from a string like

{
  "expiryDate": { "value": "{mm-dd-yyyy}" },
  "valuesNull" : false
}

...into a CacheExpiry struct.

type CachesService

type CachesService interface {
	Get(string, string) (*Cache, *Response, error)
	List(string) ([]string, *Response, error)
}

CachesService is an interface for interfacing with the Apigee Edge Admin API dealing with caches.

type CachesServiceOp

type CachesServiceOp struct {
	// contains filtered or unexported fields
}

func (*CachesServiceOp) Get

func (s *CachesServiceOp) Get(name, env string) (*Cache, *Response, error)

Get retrieves the information about a Cache in an organization, or about a cache in an environment within an organization. This information includes the properties, and the created and last modified details.

func (*CachesServiceOp) List

func (s *CachesServiceOp) List(env string) ([]string, *Response, error)

List retrieves the list of cache names for the organization referred by the ApigeeClient, or a set of cache names for a specific environment within an organization.

type CompaniesService

type CompaniesService interface {
	Create(Company) (*Company, *Response, error)
	Delete(string) (*Response, error)
	Get(string) (*Company, *Response, error)
	Update(Company) (*Company, *Response, error)
}

CompanyService is an interface for interfacing with the Apigee Edge Admin API dealing with companies.

type CompaniesServiceOp

type CompaniesServiceOp struct {
	// contains filtered or unexported fields
}

func (*CompaniesServiceOp) Create

func (s *CompaniesServiceOp) Create(company Company) (*Company, *Response, error)

func (*CompaniesServiceOp) Delete

func (s *CompaniesServiceOp) Delete(name string) (*Response, error)

func (*CompaniesServiceOp) Get

func (s *CompaniesServiceOp) Get(name string) (*Company, *Response, error)

func (*CompaniesServiceOp) Update

func (s *CompaniesServiceOp) Update(company Company) (*Company, *Response, error)

type Company

type Company struct {
	Apps        []string    `json:"apps,omitempty"`
	Attributes  []Attribute `json:"attributes,omitempty"`
	DisplayName string      `json:"displayName,omitempty"`
	Name        string      `json:"name,omitempty"`
	Status      string      `json:"status,omitempty"`
}

type CompanyApp

type CompanyApp struct {
	ApiProducts []string     `json:"apiProducts,omitempty"`
	AppFamily   string       `json:"appFamily,omitempty"`
	AppId       string       `json:"appId,omitempty"`
	Attributes  []Attribute  `json:"attributes,omitempty"`
	CallbackUrl string       `json:"callbackUrl,omitempty"`
	CompanyName string       `json:"companyName,omitempty"`
	Credentials []Credential `json:"credentials,omitempty"`
	Name        string       `json:"name,omitempty"`
	Scopes      []string     `json:"scopes,omitempty"`
	Status      string       `json:"status,omitempty"`
}

type CompanyAppCredentialsService

type CompanyAppCredentialsService interface {
	Create(string, string, Credential) (*Credential, *Response, error)
	Delete(string, string, string) (*Response, error)
	Get(string, string, string) (*Credential, *Response, error)
	RemoveApiProduct(string, string, string, string) (*Response, error)
	Update(string, string, string, Credential) (*Credential, *Response, error)
}

CompanyAppCredentialsService is an interface for interfacing with the Apigee Edge Admin API dealing with companyApp credentials/keys.

type CompanyAppCredentialsServiceOp

type CompanyAppCredentialsServiceOp struct {
	// contains filtered or unexported fields
}

func (*CompanyAppCredentialsServiceOp) Create

func (s *CompanyAppCredentialsServiceOp) Create(companyName string, appName string, companyAppCredential Credential) (*Credential, *Response, error)

Create a company app's consumer key and secret

func (*CompanyAppCredentialsServiceOp) Delete

func (s *CompanyAppCredentialsServiceOp) Delete(companyName string, appName string, consumerKey string) (*Response, error)

Delete a company app's consumer key

func (*CompanyAppCredentialsServiceOp) Get

func (s *CompanyAppCredentialsServiceOp) Get(companyName string, appName string, consumerKey string) (*Credential, *Response, error)

Get information about a company app's consumer key

func (*CompanyAppCredentialsServiceOp) RemoveApiProduct

func (s *CompanyAppCredentialsServiceOp) RemoveApiProduct(companyName string, appName string, consumerKey string, apiProductName string) (*Response, error)

Remove an API product from a company app's consumer key

func (*CompanyAppCredentialsServiceOp) Update

func (s *CompanyAppCredentialsServiceOp) Update(companyName string, appName string, consumerKey string, companyAppCredential Credential) (*Credential, *Response, error)

Update existing company app's consumer key with new API products or attributes

type CompanyAppsService

type CompanyAppsService interface {
	Create(string, CompanyApp) (*CompanyApp, *Response, error)
	Delete(string, string) (*Response, error)
	Get(string, string) (*CompanyApp, *Response, error)
	Update(string, CompanyApp) (*CompanyApp, *Response, error)
}

CompanyAppsService is an interface for interfacing with the Apigee Edge Admin API dealing with companyApps.

type CompanyAppsServiceOp

type CompanyAppsServiceOp struct {
	// contains filtered or unexported fields
}

func (*CompanyAppsServiceOp) Create

func (s *CompanyAppsServiceOp) Create(companyName string, companyApp CompanyApp) (*CompanyApp, *Response, error)

func (*CompanyAppsServiceOp) Delete

func (s *CompanyAppsServiceOp) Delete(companyName string, name string) (*Response, error)

func (*CompanyAppsServiceOp) Get

func (s *CompanyAppsServiceOp) Get(companyName string, name string) (*CompanyApp, *Response, error)

func (*CompanyAppsServiceOp) Update

func (s *CompanyAppsServiceOp) Update(companyName string, companyApp CompanyApp) (*CompanyApp, *Response, error)

type Credential

type Credential struct {
	ApiProducts    []CredentialApiProduct `json:"apiProducts,omitempty"`
	Attributes     []Attribute            `json:"attributes,omitempty"`
	ConsumerKey    string                 `json:"consumerKey,omitempty"`
	ConsumerSecret string                 `json:"consumerSecret,omitempty"`
	ExpiresAt      int                    `json:"expiresAt,omitempty"`
	IssuedAt       int                    `json:"issuedAt,omitempty"`
	Scopes         []string               `json:"scopes,omitempty"`
	Status         string                 `json:"status,omitempty"`
}

type CredentialApiProduct

type CredentialApiProduct struct {
	ApiProduct string `json:"apiproduct,omitempty"`
	Status     string `json:"status,omitempty"`
}

type DeletedItemInfo

type DeletedItemInfo struct {
	Name string `json:"name,omitempty"`
}

When Delete returns successfully, it returns a payload that contains very little useful information. This struct deserializes that information.

type Deployable

type Deployable struct{}

func (*Deployable) Delete

func (s *Deployable) Delete(client *ApigeeClient, uriPathElement, assetName string) (*DeletedItemInfo, *Response, error)

Delete an API Proxy and all its revisions from an organization. This method will fail if any of the revisions of the named API Proxy are currently deployed in any environment.

func (*Deployable) DeleteRevision

func (s *Deployable) DeleteRevision(client *ApigeeClient, uriPathElement, assetName string, rev Revision) (*DeployableRevision, *Response, error)

func (*Deployable) Deploy

func (s *Deployable) Deploy(client *ApigeeClient, uriPathElement, assetName, basepath, env string, rev Revision, override bool, delay int) (*RevisionDeployment, *Response, error)

func (*Deployable) Export

func (s *Deployable) Export(client *ApigeeClient, uriPathElement, assetName string, rev Revision) (string, *Response, error)

func (*Deployable) Get

func (s *Deployable) Get(client *ApigeeClient, uriPathElement, assetName string) (*DeployableAsset, *Response, error)

func (*Deployable) GetDeployments

func (s *Deployable) GetDeployments(client *ApigeeClient, uriPathElement, assetName string) (*Deployment, *Response, error)

func (*Deployable) Import

func (s *Deployable) Import(client *ApigeeClient, uriPathElement, assetName, source string) (*DeployableRevision, *Response, error)

func (*Deployable) List

func (s *Deployable) List(client *ApigeeClient, uriPathElement string) ([]string, *Response, error)

func (*Deployable) Undeploy

func (s *Deployable) Undeploy(client *ApigeeClient, uriPathElement, assetName, env string, rev Revision) (*RevisionDeployment, *Response, error)

type DeployableAsset

type DeployableAsset struct {
	MetaData  DeployableMetadata `json:"metaData,omitempty"`
	Name      string             `json:"name,omitempty"`
	Revisions []Revision         `json:"revision,omitempty"`
}

DeployableAsset contains information about an API Proxy or SharedFlow within an Apigee organization.

type DeployableMetadata

type DeployableMetadata struct {
	CreatedAt      Timestamp `json:"createdAt,omitempty"`
	CreatedBy      string    `json:"createdBy,omitempty"`
	LastModifiedAt Timestamp `json:"lastModifiedAt,omitempty"`
	LastModifiedBy string    `json:"lastModifiedBy,omitempty"`
}

ProxyMetadata contains information related to the creation and last modified time and actor for an API Proxy within an organization.

type DeployableRevision

type DeployableRevision struct {
	ContextInfo     string    `json:"contextInfo,omitempty"`
	CreatedAt       Timestamp `json:"createdAt,omitempty"`
	CreatedBy       string    `json:"createdBy,omitempty"`
	Description     string    `json:"description,omitempty"`
	DisplayName     string    `json:"displayName,omitempty"`
	LastModifiedAt  Timestamp `json:"lastModifiedAt,omitempty"`
	LastModifiedBy  string    `json:"lastModifiedBy,omitempty"`
	Name            string    `json:"name,omitempty"`
	Policies        []string  `json:"policies,omitempty"`
	ProxyEndpoints  []string  `json:"proxyEndpoints,omitempty"`
	Resources       []string  `json:"resources,omitempty"`
	Revision        Revision  `json:"revision,omitempty"`
	SharedFlows     []string  `json:"sharedFlows,omitempty"`
	TargetEndpoints []string  `json:"targetEndpoints,omitempty"`
	TargetServers   []string  `json:"targetServers,omitempty"`
	Type            string    `json:"type,omitempty"`
}

DeployableRevision holds information about a revision of an API Proxy, or a SharedFlow.

type Deployment

type Deployment struct {
	Environments []EnvironmentDeployment `json:"environment,omitempty"`
	Name         string                  `json:"name,omitempty"`
	Organization string                  `json:"organization,omitempty"`
}

Deployment (nee ProxyDeployment) holds information about the deployment state of a all revisions of an API Proxy or SharedFlow.

type Developer

type Developer struct {
	Apps             []string    `json:"apps,omitempty"`
	Attributes       []Attribute `json:"attributes,omitempty"`
	Companies        []string    `json:"companies,omitempty"`
	Email            string      `json:"email,omitempty"`
	FirstName        string      `json:"firstName,omitempty"`
	Id               string      `json:"uuid,omitempty"`
	LastName         string      `json:"lastName,omitempty"`
	OrganizationName string      `json:"organizationName,omitempty"`
	Status           string      `json:"status,omitempty"` // active, inactive, ??
	UserName         string      `json:"userName,omitempty"`
}

Developer contains information about a registered Developer within an Edge organization.

type DeveloperApp

type DeveloperApp struct {
	ApiProducts      []string     `json:"apiProducts,omitempty"`
	Attributes       []Attribute  `json:"attributes,omitempty"`
	CallbackUrl      string       `json:"callbackUrl,omitempty"`
	Credentials      []Credential `json:"credentials,omitempty"`
	DeveloperId      string       `json:"developerId,omitempty"`
	Id               string       `json:"appId,omitempty"`
	InitialKeyExpiry string       `json:"keyExpiresIn,omitempty"`
	Name             string       `json:"name,omitempty"`
	Scopes           []string     `json:"scopes,omitempty"`
	Status           string       `json:"status,omitempty"`
}

DeveloperApp holds information about a registered DeveloperApp.

type DeveloperAppsService

type DeveloperAppsService interface {
	Approve(string, string) (*Response, error)
	Create(string, DeveloperApp) (*DeveloperApp, *Response, error)
	Delete(string, string) (*DeveloperApp, *Response, error)
	Get(string, string) (*DeveloperApp, *Response, error)
	List(string) ([]string, *Response, error)
	Revoke(string, string) (*Response, error)
	Update(string, DeveloperApp) (*DeveloperApp, *Response, error)
}

DeveloperAppsService is an interface for interfacing with the Apigee Edge Admin API dealing with apps that belong to a particular developer.

type DeveloperAppsServiceOp

type DeveloperAppsServiceOp struct {
	// contains filtered or unexported fields
}

func (*DeveloperAppsServiceOp) Approve

func (s *DeveloperAppsServiceOp) Approve(developerEmail string, appName string) (*Response, error)

func (*DeveloperAppsServiceOp) Create

func (s *DeveloperAppsServiceOp) Create(developerEmail string, app DeveloperApp) (*DeveloperApp, *Response, error)

func (*DeveloperAppsServiceOp) Delete

func (s *DeveloperAppsServiceOp) Delete(developerEmail string, appName string) (*DeveloperApp, *Response, error)

func (*DeveloperAppsServiceOp) Get

func (s *DeveloperAppsServiceOp) Get(developerEmail string, appName string) (*DeveloperApp, *Response, error)

func (*DeveloperAppsServiceOp) List

func (s *DeveloperAppsServiceOp) List(developerEmail string) ([]string, *Response, error)

func (*DeveloperAppsServiceOp) Revoke

func (s *DeveloperAppsServiceOp) Revoke(developerEmail string, appName string) (*Response, error)

func (*DeveloperAppsServiceOp) Update

func (s *DeveloperAppsServiceOp) Update(developerEmail string, app DeveloperApp) (*DeveloperApp, *Response, error)

type DevelopersService

type DevelopersService interface {
	Approve(string) (*Response, error)
	GetApps(string) ([]DeveloperApp, *Response, error)
	Create(Developer) (*Developer, *Response, error)
	Delete(string) (*Developer, *Response, error)
	Get(string) (*Developer, *Response, error)
	List() ([]string, *Response, error)
	Revoke(string) (*Response, error)
	Update(Developer) (*Developer, *Response, error)
}

DevelopersService is an interface for interfacing with the Apigee Edge Admin API dealing with developers.

type DevelopersServiceOp

type DevelopersServiceOp struct {
	// contains filtered or unexported fields
}

func (*DevelopersServiceOp) Approve

func (s *DevelopersServiceOp) Approve(developerEmailOrId string) (*Response, error)

func (*DevelopersServiceOp) Create

func (s *DevelopersServiceOp) Create(dev Developer) (*Developer, *Response, error)

func (*DevelopersServiceOp) Delete

func (s *DevelopersServiceOp) Delete(devEmailOrId string) (*Developer, *Response, error)

func (*DevelopersServiceOp) Get

func (s *DevelopersServiceOp) Get(developerEmailOrId string) (*Developer, *Response, error)

func (*DevelopersServiceOp) GetApps added in v0.2.3

func (s *DevelopersServiceOp) GetApps(developerEmailOrId string) ([]DeveloperApp, *Response, error)

func (*DevelopersServiceOp) List

func (s *DevelopersServiceOp) List() ([]string, *Response, error)

func (*DevelopersServiceOp) Revoke

func (s *DevelopersServiceOp) Revoke(developerEmailOrId string) (*Response, error)

func (*DevelopersServiceOp) Update

func (s *DevelopersServiceOp) Update(dev Developer) (*Developer, *Response, error)

type EntryStruct

type EntryStruct struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

EntryStruct Holds the Key value map entry

type Environment

type Environment struct {
	CreatedAt      Timestamp   `json:"createdAt,omitempty"`
	CreatedBy      string      `json:"createdBy,omitempty"`
	LastModifiedAt Timestamp   `json:"lastModifiedAt,omitempty"`
	LastModifiedBy string      `json:"lastModifiedBy,omitempty"`
	Name           string      `json:"name,omitempty"`
	Properties     []Attribute `json:"properties,omitempty"`
}

Environment contains information about an environment within an Edge organization.

type EnvironmentDeployment

type EnvironmentDeployment struct {
	Name     string               `json:"name,omitempty"`
	Revision []RevisionDeployment `json:"revision,omitempty"`
}

type EnvironmentsService

type EnvironmentsService interface {
	Get(string) (*Environment, *Response, error)
	List() ([]string, *Response, error)
}

EnvironmentsService is an interface for interfacing with the Apigee Edge Admin API querying Edge environments.

type EnvironmentsServiceOp

type EnvironmentsServiceOp struct {
	// contains filtered or unexported fields
}

func (*EnvironmentsServiceOp) Get

Get retrieves the information about an Environment in an organization, information including the properties, and the created and last modified details.

func (*EnvironmentsServiceOp) List

func (s *EnvironmentsServiceOp) List() ([]string, *Response, error)

List retrieves the list of environment names for the organization referred by the ApigeeClient.

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response

	// Error message - maybe the json for this is "fault"
	Message string `json:"message"`
}

An ErrorResponse reports the error caused by an API request

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type ISOTimes

type ISOTimes struct {
	Expires  string `json:"expires,omitempty"`
	IssuedAt string `json:"issued_at,omitempty"`
}

type KeyValueMap

type KeyValueMap struct {
	Encrypted bool          `json:"encrypted,omitempty"`
	Entry     []EntryStruct `json:"entry,omitempty"`
	Name      string        `json:"name,omitempty"`
}

KeyValueMap Holds the Key value map

type KeyValueMapEntriesService

KeyValueMapEntriesService is an interface for interfacing with the Apigee Edge Admin API dealing with KeyValueMapEntry.

type KeyValueMapEntriesServiceOp

type KeyValueMapEntriesServiceOp struct {
	// contains filtered or unexported fields
}

KeyValueMapEntriesServiceOp holds creds

func (*KeyValueMapEntriesServiceOp) Create

func (s *KeyValueMapEntriesServiceOp) Create(env string, keyValueMapName string, keyValueMapEntry KeyValueMapEntryKeys) (*KeyValueMapEntry, *Response, error)

Create a new key value map entry

func (*KeyValueMapEntriesServiceOp) Delete

func (s *KeyValueMapEntriesServiceOp) Delete(env string, keyValueMapName string, keyValueMapEntry string) (*Response, error)

Delete an existing key value map entry

func (*KeyValueMapEntriesServiceOp) Get

func (s *KeyValueMapEntriesServiceOp) Get(env string, keyValueMapName string, keyValueMapEntry string) (*KeyValueMapEntryKeys, *Response, error)

Get the key value map entry

func (*KeyValueMapEntriesServiceOp) List added in v0.2.4

func (s *KeyValueMapEntriesServiceOp) List(env string, keyValueMapName string) ([]string, *Response, error)

func (*KeyValueMapEntriesServiceOp) Update

func (s *KeyValueMapEntriesServiceOp) Update(env string, keyValueMapName string, keyValueMapEntry KeyValueMapEntryKeys) (*KeyValueMapEntry, *Response, error)

Update an existing key value map entry

type KeyValueMapEntry

type KeyValueMapEntry struct {
	Entry   []KeyValueMapEntryKeys `json:"entry,omitempty"`
	KVMName string                 `json:"kvmName,omitempty"`
}

KeyValueMapEntry Holds the Key value map

type KeyValueMapEntryKeys

type KeyValueMapEntryKeys struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

KeyValueMapEntryKeys to update

type KeyValueMapsService

type KeyValueMapsService interface {
	Create(string, KeyValueMap) (*KeyValueMap, *Response, error)
	Delete(string, string) (*Response, error)
	Get(string, string) (*KeyValueMap, *Response, error)
}

KeyValueMapsService is an interface for interfacing with the Apigee Edge Admin API dealing with KeyValueMap.

type KeyValueMapsServiceOp

type KeyValueMapsServiceOp struct {
	// contains filtered or unexported fields
}

KeyValueMapsServiceOp holds creds

func (*KeyValueMapsServiceOp) Create

func (s *KeyValueMapsServiceOp) Create(env string, keyValueMap KeyValueMap) (*KeyValueMap, *Response, error)

Create a new key value map

func (*KeyValueMapsServiceOp) Delete

func (s *KeyValueMapsServiceOp) Delete(env string, name string) (*Response, error)

Delete an existing key value map

func (*KeyValueMapsServiceOp) Get

func (s *KeyValueMapsServiceOp) Get(env string, name string) (*KeyValueMap, *Response, error)

Get the Keyvaluemap

type ListOptions

type ListOptions struct {
	// to ask for expanded results
	Expand bool `url:"expand"`
}

ListOptions holds optional parameters to various List methods

type Organization

type Organization struct {
	CreatedAt      Timestamp   `json:"createdAt,omitempty"`
	CreatedBy      string      `json:"createdBy,omitempty"`
	DisplayName    string      `json:"displayName,omitempty"`
	Environments   []string    `json:"environments,omitempty"`
	LastModifiedAt Timestamp   `json:"lastModifiedAt,omitempty"`
	LastModifiedBy string      `json:"lastModifiedBy,omitempty"`
	Name           string      `json:"name,omitempty"`
	Properties     []Attribute `json:"properties,omitempty"`
	Type           string      `json:"type,omitempty"`
}

type OrganizationService

type OrganizationService interface {
	Get(string) (*Organization, *Response, error)
}

OrganizationsService is an interface for interfacing with the Apigee Edge Admin API querying Edge environments.

type OrganizationServiceOp

type OrganizationServiceOp struct {
	// contains filtered or unexported fields
}

func (*OrganizationServiceOp) Get

Get retrieves the information about an Organization, information including the properties, and the created and last modified details, the list of Environments, etc.

type ProductsService

type ProductsService interface {
	Create(ApiProduct) (*ApiProduct, *Response, error)
	Delete(string) (*ApiProduct, *Response, error)
	Get(string) (*ApiProduct, *Response, error)
	List() ([]string, *Response, error)
	Update(ApiProduct) (*ApiProduct, *Response, error)
}

ProductsService is an interface for interfacing with the Apigee Edge Admin API dealing with apiproducts.

type ProductsServiceOp

type ProductsServiceOp struct {
	// contains filtered or unexported fields
}

func (*ProductsServiceOp) Create

func (s *ProductsServiceOp) Create(product ApiProduct) (*ApiProduct, *Response, error)

func (*ProductsServiceOp) Delete

func (s *ProductsServiceOp) Delete(productName string) (*ApiProduct, *Response, error)

func (*ProductsServiceOp) Get

func (s *ProductsServiceOp) Get(productName string) (*ApiProduct, *Response, error)

Get retrieves the information about an API Product in an organization, information including the list of API Proxies, the scopes, the quota, and other attributes.

func (*ProductsServiceOp) List

func (s *ProductsServiceOp) List() ([]string, *Response, error)

List retrieves the list of apiproduct names for the organization referred by the ApigeeClient.

func (*ProductsServiceOp) Update

func (s *ProductsServiceOp) Update(product ApiProduct) (*ApiProduct, *Response, error)

type ProxiesService

ProxiesService is an interface for interfacing with the Apigee Admin API dealing with apiproxies.

type ProxiesServiceOp

type ProxiesServiceOp struct {
	// contains filtered or unexported fields
}

func (*ProxiesServiceOp) Delete

func (s *ProxiesServiceOp) Delete(proxyName string) (*DeletedItemInfo, *Response, error)

Delete an API Proxy and all its revisions from an organization. This method will fail if any of the revisions of the named API Proxy are currently deployed in any environment.

func (*ProxiesServiceOp) DeleteRevision

func (s *ProxiesServiceOp) DeleteRevision(proxyName string, rev Revision) (*DeployableRevision, *Response, error)

DeleteRevision deletes a specific revision of an API Proxy from an organization. The revision must exist, and must not be currently deployed.

func (*ProxiesServiceOp) Deploy

func (s *ProxiesServiceOp) Deploy(proxyName, env string, rev Revision, override bool, delay int) (*RevisionDeployment, *Response, error)

Deploy a revision of an API proxy to a specific environment within an organization.

func (*ProxiesServiceOp) DeployAtPath

func (s *ProxiesServiceOp) DeployAtPath(proxyName, basepath, env string, rev Revision, override bool, delay int) (*RevisionDeployment, *Response, error)

Deploy a revision of an API proxy to a specific environment within an organization.

func (*ProxiesServiceOp) Export

func (s *ProxiesServiceOp) Export(proxyName string, rev Revision) (string, *Response, error)

Export a revision of an API proxy within an organization, to a filesystem file.

func (*ProxiesServiceOp) Get

func (s *ProxiesServiceOp) Get(proxyName string) (*DeployableAsset, *Response, error)

Get retrieves the information about an API Proxy in an organization, information including the list of available revisions, and the created and last modified dates and actors.

func (*ProxiesServiceOp) GetDeployments

func (s *ProxiesServiceOp) GetDeployments(proxyName string) (*Deployment, *Response, error)

GetDeployments retrieves the information about deployments of an API Proxy in an organization, including the environment names and revision numbers.

func (*ProxiesServiceOp) Import

func (s *ProxiesServiceOp) Import(proxyName string, source string) (*DeployableRevision, *Response, error)

Import an API proxy into an organization, creating a new API Proxy revision. The proxyName can be passed as "nil" in which case the name is derived from the source. The source can be either a filesystem directory containing an exploded apiproxy bundle, OR the path of a zip file containing an API Proxy bundle. Returns the API proxy revision information. This method does not deploy the imported proxy. See the Deploy method.

func (*ProxiesServiceOp) List

func (s *ProxiesServiceOp) List() ([]string, *Response, error)

retrieve the list of apiproxy names for the organization referred by the ApigeeClient.

func (*ProxiesServiceOp) Undeploy

func (s *ProxiesServiceOp) Undeploy(proxyName, env string, rev Revision) (*RevisionDeployment, *Response, error)

Undeploy a specific revision of an API Proxy from a particular environment within an Edge organization.

type RequestCompletionCallback

type RequestCompletionCallback func(*http.Request, *http.Response)

RequestCompletionCallback defines the type of the request callback function

type Response

type Response struct {
	*http.Response
}

wrap the standard http.Response returned from Apigee Edge. (why?)

type Revision

type Revision int

Revision represents a revision number. Edge returns rev numbers in string form. This marshals and unmarshals between that format and int.

func (*Revision) MarshalJSON

func (r *Revision) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. It marshals from a Revision holding an integer value like 2, into a string like "2".

func (Revision) String

func (r Revision) String() string

func (*Revision) UnmarshalJSON

func (r *Revision) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. It unmarshals from a string like "2" (including the quotes), into an integer 2.

type RevisionDeployment

type RevisionDeployment struct {
	Number  Revision       `json:"name,omitempty"`
	Servers []ApigeeServer `json:"server,omitempty"`
	State   string         `json:"state,omitempty"`
}

type SSLInfo

type SSLInfo struct {
	Ciphers                []string `json:"ciphers,omitempty"`
	ClientAuthEnabled      string   `json:"clientAuthEnabled,omitempty"`
	IgnoreValidationErrors bool     `json:"ignoreValidationErrors"`
	KeyAlias               string   `json:"keyAlias,omitempty"`
	KeyStore               string   `json:"keyStore,omitempty"`
	Protocols              []string `json:"protocols,omitempty"`
	SSLEnabled             string   `json:"enabled,omitempty"`
	TrustStore             string   `json:"trustStore,omitempty"`
}

For some reason Apigee returns SOME bools as strings and others a bools.

type SharedFlowsService

type SharedFlowsService interface {
	Delete(string) (*DeletedItemInfo, *Response, error)
	DeleteRevision(string, Revision) (*DeployableRevision, *Response, error)
	Deploy(string, string, Revision, bool, int) (*RevisionDeployment, *Response, error)
	Export(string, Revision) (string, *Response, error)
	Get(string) (*DeployableAsset, *Response, error)
	GetDeployments(string) (*Deployment, *Response, error)
	Import(string, string) (*DeployableRevision, *Response, error)
	List() ([]string, *Response, error)
	Undeploy(string, string, Revision) (*RevisionDeployment, *Response, error)
}

SharedFlowsService is an interface for interfacing with the Apigee Admin API dealing with apiproxies.

type SharedFlowsServiceOp

type SharedFlowsServiceOp struct {
	// contains filtered or unexported fields
}

func (*SharedFlowsServiceOp) Delete

func (s *SharedFlowsServiceOp) Delete(proxyName string) (*DeletedItemInfo, *Response, error)

func (*SharedFlowsServiceOp) DeleteRevision

func (s *SharedFlowsServiceOp) DeleteRevision(proxyName string, rev Revision) (*DeployableRevision, *Response, error)

func (*SharedFlowsServiceOp) Deploy

func (s *SharedFlowsServiceOp) Deploy(proxyName, env string, rev Revision, override bool, delay int) (*RevisionDeployment, *Response, error)

func (*SharedFlowsServiceOp) Export

func (s *SharedFlowsServiceOp) Export(proxyName string, rev Revision) (string, *Response, error)

func (*SharedFlowsServiceOp) Get

func (s *SharedFlowsServiceOp) Get(proxyName string) (*DeployableAsset, *Response, error)

func (*SharedFlowsServiceOp) GetDeployments

func (s *SharedFlowsServiceOp) GetDeployments(proxyName string) (*Deployment, *Response, error)

func (*SharedFlowsServiceOp) Import

func (s *SharedFlowsServiceOp) Import(proxyName string, source string) (*DeployableRevision, *Response, error)

func (*SharedFlowsServiceOp) List

func (s *SharedFlowsServiceOp) List() ([]string, *Response, error)

func (*SharedFlowsServiceOp) Undeploy

func (s *SharedFlowsServiceOp) Undeploy(proxyName, env string, rev Revision) (*RevisionDeployment, *Response, error)

type TargetServer

type TargetServer struct {
	Enabled bool     `json:"isEnabled"`
	Host    string   `json:"host,omitempty"`
	Name    string   `json:"name,omitempty"`
	Port    int      `json:"port,omitempty"`
	SSLInfo *SSLInfo `json:"sSLInfo,omitempty"`
}

type TargetServersService

type TargetServersService interface {
	Create(TargetServer, string) (*TargetServer, *Response, error)
	Delete(string, string) (*Response, error)
	Get(string, string) (*TargetServer, *Response, error)
	Update(TargetServer, string) (*TargetServer, *Response, error)
}

TargetServersService is an interface for interfacing with the Apigee Edge Admin API dealing with target servers.

type TargetServersServiceOp

type TargetServersServiceOp struct {
	// contains filtered or unexported fields
}

func (*TargetServersServiceOp) Create

func (s *TargetServersServiceOp) Create(targetServer TargetServer, env string) (*TargetServer, *Response, error)

func (*TargetServersServiceOp) Delete

func (s *TargetServersServiceOp) Delete(name string, env string) (*Response, error)

func (*TargetServersServiceOp) Get

func (*TargetServersServiceOp) Update

func (s *TargetServersServiceOp) Update(targetServer TargetServer, env string) (*TargetServer, *Response, error)

type Timespan

type Timespan struct {
	time.Duration
}

Timespan represents a timespan that can be parsed from a string like "3d" meaning "3 days". It will typically be serialized as milliseconds = milliseconds-since-unix-epoch.

func NewTimespan

func NewTimespan(initializer string) *Timespan

func (Timespan) MarshalJSON

func (span Timespan) MarshalJSON() ([]byte, error)

func (Timespan) String

func (span Timespan) String() string

func (*Timespan) UnmarshalJSON

func (span *Timespan) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp represents a time that can be unmarshalled from a JSON string formatted as "java time" = milliseconds-since-unix-epoch.

func (Timestamp) Equal

func (t Timestamp) Equal(u Timestamp) bool

Equal reports whether t and u are equal based on time.Equal

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.

type VirtualHost

type VirtualHost struct {
	// Interfaces           []string   `json:"interfaces,omitempty"`
	// PropagateTLSInformation hash    `json:"propagateTLSInformation,omitempty"`
	BaseUrl       string   `json:"baseUrl,omitempty"`
	HostAliases   []string `json:"hostAliases,omitempty"`
	ListenOptions []string `json:"listenOptions,omitempty"`
	Name          string   `json:"name,omitempty"`
	Port          int      `json:"port,omitempty"`
	Properties    []string `json:"properties,omitempty"`
	RetryOptions  []string `json:"retryOptions,omitempty"`
	SSLInfo       []string `json:"sSLInfo,omitempty"`
}

https://docs.apigee.com/api-platform/fundamentals/virtual-host-property-reference

type VirtualHostsService

type VirtualHostsService interface {
	Create(VirtualHost, string) (*VirtualHost, *Response, error)
	Delete(string, string) (*Response, error)
	Get(string, string) (*VirtualHost, *Response, error)
	List(string) ([]string, *Response, error)
	Update(VirtualHost, string) (*VirtualHost, *Response, error)
}

VirtualHostService is an interface for interfacing with the Apigee Edge Admin API dealing with target servers.

type VirtualHostsServiceOp

type VirtualHostsServiceOp struct {
	// contains filtered or unexported fields
}

func (*VirtualHostsServiceOp) Create

func (s *VirtualHostsServiceOp) Create(VirtualHost VirtualHost, env string) (*VirtualHost, *Response, error)

func (*VirtualHostsServiceOp) Delete

func (s *VirtualHostsServiceOp) Delete(name string, env string) (*Response, error)

func (*VirtualHostsServiceOp) Get

func (s *VirtualHostsServiceOp) Get(name string, env string) (*VirtualHost, *Response, error)

func (*VirtualHostsServiceOp) List

func (s *VirtualHostsServiceOp) List(env string) ([]string, *Response, error)

func (*VirtualHostsServiceOp) Update

func (s *VirtualHostsServiceOp) Update(VirtualHost VirtualHost, env string) (*VirtualHost, *Response, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL