Documentation ¶
Index ¶
- Constants
- Variables
- func AddWid(projectID string, namespace string, kServiceAccount string, ...) (err error)
- func ClearEntityPayloadList()
- func CreateIAMServiceAccount(name string, iamRole string) (err error)
- func DeletePreferencesFile() (err error)
- func DownloadFile(url string, auth bool) (resp *http.Response, err error)
- func DownloadResource(url string, name string, resType string, auth bool) error
- func DryRun() bool
- func Every(duration time.Duration, work func(time.Time) bool) chan bool
- func FetchAsyncBundle(entityType string, folder string, name string, revision string, ...)
- func FetchBundle(entityType string, folder string, name string, revision string, ...) error
- func FolderExists(folder string) (err error)
- func GetApigeeEnv() string
- func GetApigeeOrg() string
- func GetApigeeToken() string
- func GetAsyncEntity(entityURL string, wg *sync.WaitGroup, mu *sync.Mutex)
- func GetDefaultOrg() (org string)
- func GetEntityPayloadList() [][]byte
- func GetHttpClient() (client *http.Client, err error)
- func GetLastCheck() (lastCheck string)
- func GetNoCheck() bool
- func GetPreferences() (err error)
- func GetPrintOutput() bool
- func GetProjectID() string
- func GetProxyURL() string
- func GetServiceAccount() string
- func GetStaging() bool
- func GetToken() (token string)
- func HttpClient(print bool, params ...string) (respBody []byte, err error)
- func ImportBundle(entityType string, name string, bundlePath string) error
- func ImportBundleAsync(entityType string, name string, bundlePath string, wg *sync.WaitGroup)
- func IsSkipCache() bool
- func IsSkipCheck() bool
- func IsSkipLogInfo() bool
- func NewApigeeClient(o ApigeeClientOptions)
- func PostHttpOctet(print bool, update bool, url string, formParams map[string]string) (respBody []byte, err error)
- func PostHttpZip(print bool, auth bool, method string, url string, headers map[string]string, ...) (err error)
- func PrettyPrint(body []byte) error
- func ReadArchive(filename string) ([]byte, error)
- func ReadBundle(filename string) error
- func ReadPreferencesFile() (err error)
- func RemoveIAMPermission(memberName string, iamRole string) (err error)
- func SetAccessToken() error
- func SetApigeeEnv(env string)
- func SetApigeeOrg(org string) (err error)
- func SetApigeeToken(token string)
- func SetAuthHeader(req *http.Request) (*http.Request, error)
- func SetIAMPermission(memberName string, iamRole string, memberType string) (err error)
- func SetNoCheck(nocheck bool) (err error)
- func SetPrintOutput(output bool)
- func SetProjectID(projectID string)
- func SetProxy(url string) (err error)
- func SetProxyURL(proxyurl string)
- func SetServiceAccount(serviceAccount string)
- func SetSkipLogInfo(l bool)
- func SetStaging(usestage bool) (err error)
- func TestAndUpdateLastCheck() (updated bool, err error)
- func UseStaging()
- func WriteArrayByteArrayToFile(exportFile string, fileAppend bool, payload [][]byte) error
- func WriteByteArrayToFile(exportFile string, fileAppend bool, payload []byte) error
- func WriteDefaultOrg(org string) (err error)
- func WritePerferencesFile(payload []byte) (err error)
- func WriteToken(token string) (err error)
- type ApigeeClientOptions
Constants ¶
const CrmURL = "https://cloudresourcemanager.googleapis.com/v1/projects/"
CrmURL is the endpoint for cloud resource manager
Variables ¶
var BaseURL = "https://apigee.googleapis.com/v1/organizations/"
BaseURL is the Apigee control plane endpoint
var StageBaseURL = "https://staging-apigee.sandbox.googleapis.com/v1/organizations/"
Functions ¶
func AddWid ¶
func AddWid(projectID string, namespace string, kServiceAccount string, gServiceAccount string) (err error)
AddWid add workload identity role to a service account
func ClearEntityPayloadList ¶
func ClearEntityPayloadList()
func CreateIAMServiceAccount ¶
CreateIAMServiceAccount create a new IAM SA with the necessary roles for Apigee
func DeletePreferencesFile ¶
func DeletePreferencesFile() (err error)
func DownloadResource ¶
DownloadResource method is used to download resources, proxy bundles, sharedflows
func FetchAsyncBundle ¶
func FetchAsyncBundle(entityType string, folder string, name string, revision string, allRevisions bool, wg *sync.WaitGroup)
FetchAsyncBundle can download a shared flow or a proxy bundle
func FetchBundle ¶
func FetchBundle(entityType string, folder string, name string, revision string, allRevisions bool) error
FetchBundle can download a shared flow or proxy bundle
func FolderExists ¶
func GetApigeeToken ¶
func GetApigeeToken() string
GetApigeeToken get the access token value in client opts (does not generate it)
func GetAsyncEntity ¶
GetAsyncEntity stores results for each entity in a list
func GetDefaultOrg ¶
func GetDefaultOrg() (org string)
func GetEntityPayloadList ¶
func GetEntityPayloadList() [][]byte
func GetHttpClient ¶
func GetLastCheck ¶
func GetLastCheck() (lastCheck string)
func GetNoCheck ¶
func GetNoCheck() bool
func GetPreferences ¶
func GetPreferences() (err error)
func GetStaging ¶
func GetStaging() bool
func HttpClient ¶
HttpClient method is used to GET,POST,PUT or DELETE JSON data
func ImportBundle ¶
ImportBundle imports a sharedflow or api proxy bundle
func ImportBundleAsync ¶
ImportBundleAsync imports a sharedflow or api proxy bundle meantot be called asynchronously
func NewApigeeClient ¶
func NewApigeeClient(o ApigeeClientOptions)
NewApigeeClient sets up options to invoke Apigee APIs
func PostHttpOctet ¶
func PostHttpOctet(print bool, update bool, url string, formParams map[string]string) (respBody []byte, err error)
PostHttpOctet method is used to send resources, proxy bundles, shared flows etc.
func PostHttpZip ¶
func PostHttpZip(print bool, auth bool, method string, url string, headers map[string]string, zipfile string) (err error)
PostHttpZip method is used to send resources, proxy bundles, shared flows etc.
func ReadArchive ¶
ReadArchive confirms f the file format is zip and reads the contents are a byte[]
func ReadBundle ¶
ReadBundle confirms if the file format is a zip file
func ReadPreferencesFile ¶
func ReadPreferencesFile() (err error)
func RemoveIAMPermission ¶
RemoveIAMPermission removes/unbinds IAM permission from all roles for an Apigee Env
func SetAccessToken ¶
func SetAccessToken() error
SetAccessToken read from cache or if not found or expired will generate a new one
func SetApigeeToken ¶
func SetApigeeToken(token string)
SetApigeeToken sets the access token for use with Apigee API calls
func SetIAMPermission ¶
SetIAMPermission set permissions for a member on an Apigee Env
func SetNoCheck ¶
func SetStaging ¶
func TestAndUpdateLastCheck ¶
func WriteArrayByteArrayToFile ¶
WriteArrayByteArrayToFile accepts [][]bytes and writes to a file
func WriteByteArrayToFile ¶
WriteByteArrayToFile accepts []bytes and writes to a file
func WriteDefaultOrg ¶
func WritePerferencesFile ¶
WritePreferencesFile
func WriteToken ¶
Types ¶
type ApigeeClientOptions ¶
type ApigeeClientOptions struct { Org string //Apigee org Env string //Apigee environment Token string //Google OAuth access token ServiceAccount string //Google service account json ProjectID string //GCP Project ID SkipLogInfo bool //LogInfo controls the log level SkipCheck bool //skip checking access token expiry SkipCache bool //skip writing access token to file PrintOutput bool //prints output from http calls NoOutput bool //disables printing API responses ProxyUrl string //use a proxy url }
ApigeeClientOptions is the base struct to hold all command arguments