Skip to main content

A Pip Package for Akamai Property

Project description

A Python Class for Akamai Property

An Object oriented implementation of Akamai Property. The advantage of Akamai Property class is application developers need not know about the PAPI calls and their usage. Application developers can just focus on getting their work done on Property Manager configs programmatically using the objects of AkamaiProperty.

Credentials

In order to use this configuration, you need to:

  • Set up your credential files as described in the authorization and credentials sections of the getting started guide on developer.akamai.com.
  • When working through this process you need to give grants for the property manager API and the User Admin API (if you will want to move properties). The section in your configuration file should be called 'papi'.

Overview

The advantage of Akamai Property class is application developers need not know about the PAPI calls and their usage. Application developers can just focus on getting their work done on Property Manager configs programmatically using the objects of AkamaiProperty.

Install Dependencies If you are using source code.

$ pip install -r requirements.txt

Install pip package available

$ pip install akamaiproperty

Instantiate the object.

>>> from akamaiproperty import AkamaiProperty
>>> myProperty = AkamaiProperty("/Users/apadmana/.edgerc","test_bulkseach_update_1","<accountSwitchKey>")
>>> myProperty = AkamaiProperty("/Users/apadmana/.edgerc","test_bulkseach_update_1")

Print Basic Information

>>> myProperty.printPropertyInfo()
Property Name: test_bulkseach_update_1
Property Id: prp_605086
Contract Id: ctr_C-1IE2OHM
Group Id: grp_163363
Active Staging Version: 96
Active Production Version: 18

Create a new version

>>> myProperty.createVersion(18)
'78'

Get rule Tree

>>>myProperty.getRuleTree(18)
{'accountId': 'act_B-C-1IE2OH8', 'contractId': 'ctr_C-1IE2OHM', 'groupId': 'grp_163363', 'propertyId': 'prp_605086', 'propertyName': 'test_bulkseach_update_1', 'propertyVersion': 18, 'etag': 'd0d28a6b71e665144955f7f7e1ff214933d119d7', 'rules':.....}

Activate the config on Staging

>>>myProperty.activateStaging(18,"testing activation",["apadmana@akamai.com"])
True

Activate the config on Production

>>>myProperty.activateProduction(18,"testing activation",["apadmana@akamai.com"])
True

Get the version Active on Staging

>>>myProperty.getStagingVersion()
20

Get the version Active on Production

>>>myProperty.getProductionVersion()
18

Get the HostNames Present in the Config

>>>myProperty.getHostnames(12)
['achuth-lab.edgesuite-staging.net', 'achuth-lab.edgesuite.net']

Get the Available Behaviours in the Config

>>>myProperty.getAvailableFeatures(12)
['advanced', 'akamaizer', 'akamaizerTag', 'allHttpInCacheHierarchy', 'allowCloudletsOrigins', 'allowDelete', 'allowOptions', 'allowPatch', 'allowPost', 'allowPut', 'allowTransferEncoding', 'apiPrioritization', 'autoDomainValidation', 'baseDirectory', 'breakConnection', 'brotli', 'cacheError', 'cacheId', 'cacheKeyIgnoreCase', 'cacheKeyQueryParams', 'cacheKeyRewrite', 'cachePost', 'cacheRedirect', 'cacheTagVisible', 'caching', 'centralAuthorization', 'chaseRedirects', 'cloudInterconnects', 'constructResponse', 'corsSupport', 'cpCode', 'customBehavior', 'datastream', 'denyAccess', 'deviceCharacteristicCacheId', 'deviceCharacteristicHeader', 'dnsAsyncRefresh', 'dnsPrefresh', 'downstreamCache', 'edgeConnect', 'edgeImageConversion', 'edgeOriginAuthorization', 'edgeRedirector', 'edgeScape', 'edgeSideIncludes', 'enhancedAkamaiProtocol', 'failAction', 'failoverBotManagerFeatureCompatibility', 'firstPartyMarketing', 'forwardRewrite', 'globalRequestNumber', 'graphqlCaching', 'gzipResponse', 'healthDetection', 'http2', 'httpStrictTransportSecurity', 'imOverride', 'imageManager', 'instant', 'largeFileOptimization', 'mPulse', 'modifyIncomingRequestHeader', 'modifyIncomingResponseHeader', 'modifyOutgoingRequestHeader', 'modifyOutgoingResponseHeader', 'origin', 'originCharacteristics', 'persistentClientConnection', 'persistentConnection', 'personallyIdentifiableInformation', 'prefetch', 'prefetchable', 'prefreshCache', 'readTimeout', 'realUserMonitoring', 'redirect', 'redirectplus', 'refererChecking', 'removeQueryParameter', 'removeVary', 'report', 'requestControl', 'responseCode', 'responseCookie', 'returnCacheStatus', 'rewriteUrl', 'rumCustom', 'savePostDcaProcessing', 'scheduleInvalidation', 'setVariable', 'simulateErrorCode', 'siteShield', 'sureRoute', 'tcpOptimization', 'tieredDistribution', 'timeout', 'validateEntityTag', 'verifyTokenAuthorization', 'visitorPrioritization', 'watermarkUrl', 'webApplicationFirewall', 'webdav']

Get the Used Behaviours in the Config

>>>myProperty.getUsedBehaviors(12)
['origin', 'cpCode', 'caching', 'tieredDistribution', 'prefetch', 'allowPost', 'report', 'mPulse', 'gzipResponse', 'prefetchable', 'downstreamCache', 'removeVary', 'allowTransferEncoding', 'http2', 'deviceCharacteristicCacheId', 'deviceCharacteristicHeader', 'cacheKeyQueryParams', 'edgeRedirector', 'advanced', 'edgeSideIncludes', 'rewriteUrl', 'setVariable', 'forwardRewrite', 'modifyIncomingResponseHeader', 'cacheTagVisible', 'cacheId']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

akamaiproperty-1.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file akamaiproperty-1.3-py3-none-any.whl.

File metadata

  • Download URL: akamaiproperty-1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.0

File hashes

Hashes for akamaiproperty-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 46d25ab270c47ba873f35d61dfe2cc4936dcfc5547b6c10b2d93a56a4deefb3b
MD5 5677fc1fbd7d5e9157c335b6ae555d49
BLAKE2b-256 4339ce15378446ddbffa0c71d0c97161af91c532307d16af54f71885c2027301

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page