Categorygithub.com/apiheat/go-edgegrid
modulepackage
5.0.4+incompatible
Repository: https://github.com/apiheat/go-edgegrid.git
Documentation: pkg.go.dev

# README

go-edgegrid

Golang based client for interaction with Akamai API services.

Coverage

This go-edgegrid API client package covers in most cases complete APIs. Below you can see highlight of services supported by the client:

ResourceCoverage
Adaptive Accelerationpartial
Network Listscomplete
Property APIs ( PAPI )partial
Identity Management - userpartial
Identity Management - APIpartial
Firewall Rule notificationscomplete
Siteshieldcomplete

To add new/update existing features create a new PR

Using go-edgegrid in your code

client

To start using the client you just need to reference package within your code.

import "github.com/apiheat/go-edgegrid"

Construct a new Akamai client, then use the various services on the client to access different parts of the akamai API.

apiClientOpts := &edgegrid.ClientOptions{}
apiClientOpts.ConfigPath =  "/path/to/.edgerc/"
apiClientOpts.ConfigSection = "default"
apiClientOpts.DebugLevel = "warn"


// create new Akamai API client
akamaiApi, err := edgegrid.NewClient(nil, apiClientOpts)

The debug property apiClientOpts.DebugLevel is optional and can be lower case string of debug warn info error fatal panic

Once created you will have access to exposed services on akamaiApi client object.

Support for Account Switch Key ( manage multiple accounts )

Client in version starting from v5.x.x supports account switch key which allows you to manage multiple accounts with single credentials.

  • Specify when initialising client

    // if using to manage multiple accounts
    apiClientOpts.AccountSwitchKey = "1-231-213123"
    
  • Using exposed functions to control account switch key

    // EnableAccountSwitchKey instructs client to use ASK
    EnableAccountSwitchKey()
    
    // DisableAccountSwitchKey instructs client to not use ASK
    DisableAccountSwitchKey()
    
    // SetAccountSwitchKey instructs client to not use ASK
    SetAccountSwitchKey(accountSwitchKey string)
    

Current setup of the client client will use account switch key if value for it have been provided during the init.You can control if account switch key is enabled via exposed methods to enable or disable the account switch key

More information can be found under the following link https://learn.akamai.com/en-us/learn_akamai/getting_started_with_akamai_developers/developer_tools/accountSwitch.html

Development

  • More info to come

Tests

  • The biggest thing this package still needs is tests :disappointed:

Issues

Authors

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Inspired by

# Functions

AuthString takes prm and returns a string that can be used as the `Authorization` header in making Akamai API requests.
Init initializes using a configuration file in standard INI format.
NewClient returns a new edgegrid.Client for API.
ShowJSONMessage returns string JSON message.

# Constants

Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.
Akamai Services Paths.

# Structs

No description provided by the author
An AkamaiGeneralError reports one or more errors caused by an API request.
AkamaiUser data.
No description provided by the author
No description provided by the author
Akamai {OPEN} EdgeGrid Authentication Service.
No description provided by the author
No description provided by the author
Client represents Akamai's API client for communicating with service.
ClientOptions represents options we can pass during client creation.
ClientResponse represents response from our API call.
No description provided by the author
No description provided by the author
DebugService allows to interact with client debugging options .
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
An EdgegridError is used to provide higher level clients with error which occured.
EdgercCredentials are items from config file.
No description provided by the author
No description provided by the author
FRNSubscription data representation.
FRNSubscriptions data representation.
GhostLocationsResp Provides location of Akamai ghost.
No description provided by the author
ListNetworkListsOptionsv2 represents the available options for listing network lists Akamai API docs: https://developer.akamai.com/api/cloud_security/network_lists/v2.html.
NetworkListActivationOptsv2 represents object used for activating network list in Akamai Akamai API docs: https://developer.akamai.com/api/cloud_security/network_lists/v2.html.
NetworkListActivationStatusv2 represents object used for status of network list activation Akamai API docs: https://developer.akamai.com/api/cloud_security/network_lists/v2.html.
NetworkListDeleteResponse represents response from deleting a list.
NetworkListErrorv2 represents the error returned from Akamai Akamai API docs: https://developer.akamai.com/api/cloud_security/network_lists/v2.html#errors.
AkamaiNetworkListLinks represents the network list `links` structure Akamai API docs: https://developer.akamai.com/api/luna/network-list.
NetworkListServicev2 represents exposed services to manage network lists Akamai API docs: https://developer.akamai.com/api/luna/network-list.
NetworkListsOptionsv2 represents struct required to create items for network list Akamai API docs: https://developer.akamai.com/api/cloud_security/network_lists/v2.html.
NetworkListSubscription represents object used for (un)subscribing for notifications.
NetworkListsv2 represents array of network lists Akamai API docs: https://developer.akamai.com/api/luna/network-list.
NetworkListv2 represents the network list structure Akamai API docs: https://developer.akamai.com/api/luna/network-list.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PropertyService represents exposed services to manage properties Akamai API docs: https://developer.akamai.com/api/luna/papi.
QStrAdaptiveAcceleration includes query params used across AdaptiveAccelerationService.
QStrAPIClientCredentials contains query string parameters used across calls for API part of Identity Management.
No description provided by the author
No description provided by the author
QStrDiagTools includes query params used for diagnostic tools.
QStrFRN includes query params used across firewall network rules.
QStrNetworkList includes query params used across network lists.
QStrPropertyAPI includes query params used across calls for PAPI.
QStrReporting includes query params used for reporting.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TODO: Change TypeOfReport into string consts ?ReportOptions represents options available for report generation.
SiteShieldMap struct.
SiteShieldMapsResp response struct.
No description provided by the author

# Type aliases

AkamaiEnvironment represents Akamai's target environment type.
AkamaiEnvironmentVar represents Akamai's env variables used.
AkamaiRequestFrom represents Akamai's source for request.
AkamaiSubscription represents Akamai's notification actions for subscriptions.
FRNCidrs data representation.
FRNServices data representation.