This package groups Edgio Organization specific funcs.
org.NewClient(params common.ClientParams) (ClientStruct, error)
credentials := common.Creds{
Key: "some-api-key",
Secret: "some-api-secret",
}
client, _ := org.NewClient(common.ClientParams{Credentials: credentials})
This func returns a new client with the provided parameters, with an access token already set, and the default edgio params values for service, scope and API version (which can be overwritten if needed) to interact with your application’s orgs.
org.NewClient
Mandatory Paramsparams.Credentials
params.Credentials.Key
: Edgio REST API Client Key. This is the API Client’s identifier on Edgio. You can generate your api client accessing https://edgio.app/<your-org-name>/clients
.params.Credentials.Secret
: Edgio REST API Client Secret. This is the API Client’ secret, unique for each API Client. You can generate your api client accessing https://edgio.app/<your-org-name>/clients
.org.NewClient
Optional Params & Default Valuesparams.Credentials
params.Credentials.Scopes
: Edgio REST API Client scopes requested by the client. Different APIs needs different scopes. Refer to the REST API docs to figure which ones you need.
app.cache+app.cache.purge+app.waf+app.waf:edit+app.waf:read+app.accounts+app.config
(all scopes).params.Credentials.AuthURL
: Edgio REST API auth url. You will probably never need to change this, but we included the option just in case (e. g.: future enterprise self-hosted option).
https://id.edgio.app/connect/token
(Edgio’s default auth API url).params.Config
params.Config.ApiVersion
: Intended REST API Version. Each one of the Edgio REST APIs has its own Version, that must be provided when creating the client.
v0.1
params.Config.Service
: Intended REST API Service. Each one of the Edgio REST APIs has its own Service, that must be provided when creating the client.
accounts
params.Config.Scope
: Intended REST API Scope. Each one of the Edgio REST APIs has its own Scope, that must be provided when creating the client.
organizations
params.Config.Url
: Edgio REST API resources url. You will probably never need to change this, but we included the option just in case (e. g.: future enterprise self-hosted option).
https://edgioapis.com
(Edgio’s default resources API url).org.Get(params common.URLParams) (getResultType, error)
credentials := common.Creds{
Key: "some-api-key",
Secret: "some-api-secret",
}
client, _ := org.NewClient(common.ClientParams{Credentials: credentials})
client.Get(common.URLParams{Path: "some-org-id"}) // { "ID": "org-id", "Name": "org-name" }
This func returns the relevant organization details (name and id).
org.Get
Mandatory Paramsparams.Path
: Edgio Organization id to be retrieved.org.Get
Optional Params & Default ValuesThere is no optional parameters for that function
org.Patch(params common.URLParams, body PatchBody) (common.Org, error)
credentials := common.Creds{
Key: "some-api-key",
Secret: "some-api-secret",
}
client, _ := org.NewClient(common.ClientParams{Credentials: credentials})
client.Patch(common.URLParams{Path: "some-org-id"}, org.PatchBody{Name: "Some New Org Name"}) // { "ID": "org-id", "Name": "Some New Org Name" }
This func updates the relevant Org’s name and return the Org object with the new data.
org.Patch
Mandatory Paramsparams.Path
: Edgio Organization id to be retrieved.body.Name
: The New name for the organization.org.Patch
Optional Params & Default ValuesThere is no optional parameters for that function