Module Expr Str Import alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore Str TryExcept body Assign NameStore Call NameLoad Dict Str NameLoad NameLoad Dict Str Str handlers ExceptHandler body Assign NameStore BinOpMod Str NameLoad AugAssignAdd NameStore Str AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr If BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore NameLoad If NameLoad body Import alias identifier Assign AttributeStore AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore BinOpMod Str TupleLoad Str AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults NameLoad body If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr ListLoad BinOpAdd NameLoad Str NameLoad orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr If NameLoad body Print BinOpAdd BinOpAdd Str Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Num Str Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq NameLoad Num body Assign NameStore BinOpMod Str NameLoad AugAssignAdd NameStore Str AugAssignAdd NameStore Str AugAssignAdd NameStore Str AugAssignAdd NameStore BinOpMod Str SubscriptLoad NameLoad Index Str Expr Call NameLoad NameLoad If CompareIn NameLoad ListLoad Num Num body Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad AugAssignAdd NameStore Str AugAssignAdd NameStore Str AugAssignAdd NameStore Str AugAssignAdd NameStore BinOpMod Str SubscriptLoad NameLoad Index Str Expr Call NameLoad NameLoad If CompareIn NameLoad ListLoad Num body Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad AugAssignAdd NameStore Str AugAssignAdd NameStore Str AugAssignAdd NameStore Str AugAssignAdd NameStore BinOpMod Str SubscriptLoad NameLoad Index Str Expr Call NameLoad NameLoad Assign NameStore NameLoad If CompareIn Str NameLoad body If SubscriptLoad NameLoad Index Str body Assign NameStore SubscriptLoad NameLoad Index Str orelse For NameStore NameLoad body If CompareIsNot Call NameLoad NameLoad NameLoad body Continue If CompareIs Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str NameLoad body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str If NameLoad body Assign NameStore Str AugAssignAdd NameStore Str AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Print Print Str Assign NameStore Call NameLoad Str Print BinOpMod Str Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Print BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Num Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Print Print BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Num Print BinOpMod Str NameLoad Print Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad Str NameLoad Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Print BinOpMod Str NameLoad Expr Str Assign NameStore Dict For NameStore NameLoad body If CompareNotEq SubscriptLoad NameLoad Index Str NameLoad body Continue Assign NameStore NameLoad If UnaryOpNot NameLoad body Print BinOpMod Str NameLoad Expr Call NameLoad Print BinOpMod Str NameLoad Print BinOpMod Str SubscriptLoad NameLoad Index Str Print BinOpMod Str SubscriptLoad NameLoad Index Str Print BinOpMod Str SubscriptLoad NameLoad Index Str Print BinOpMod Str SubscriptLoad NameLoad Index Str Print BinOpMod Str SubscriptLoad NameLoad Index Str Return TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Print Print Str Assign NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Dict Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad NameLoad For NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str body If CompareNotEq SubscriptLoad NameLoad Index Str NameLoad body Continue Print BinOpMod Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Dict Str Str Str Str If CompareIn NameLoad NameLoad body Return SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Print Str Assign NameStore Dict Str Str Assign SubscriptStore NameLoad Index Str Str Assign NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str NameLoad Assign NameStore ListLoad For NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str body If CompareNotEq SubscriptLoad NameLoad Index Str NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign NameStore Dict Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr ListLoad BinOpAdd NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad keyword Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If CompareNotEq AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body If NameLoad body Print BinOpAdd BinOpAdd Str Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Num Str Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Assign NameStore Dict Assign NameStore Str Assign NameStore Str Assign TupleStore SubscriptStore NameLoad Index Str SubscriptStore NameLoad Index Str Call NameLoad Assign TupleStore SubscriptStore NameLoad Index Str NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Print If BoolOpAnd Call NameLoad NameLoad Str AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad
N/A N/A  Copyright 2015 Akamai Technologies, Inc. All Rights Reserved.
 
 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

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 
Sample client 
In order to use this papi client you will need to have access turned
on for your account.  Send the contract IDs you want activated in a 
request to open-developer@akamai.com.

This script pulls the contract groups, products for that group, and
then looks for a property named "Papitest1".  You can change the 
particular items it's looking for easily enough - right now all it
does is pull the first group, first contract, first product, which
is where the test property lives.

When you run the script with the --write flag, it will toggle the
prefetch bit on the test property.

Please send any comments, questions or ideas to open-developer@akamai.com

Thanks!
The Akamai Developer Relations Team

 N/A requests logging json random randint akamai.edgegrid EdgeGridAuth config EdgeGridConfig urlparse urljoin N/A urllib N/A session N/A N/A requests Session N/A debug False N/A section_name papi N/A N/A N/A config N/A EdgeGridConfig N/A verbose False section_name N/A write count N/A N/A N/A N/A error_msg N/A ERROR: No section named %s was found in your ~/.edgerc file
 section_name N/A error_msg ERROR: Please generate credentials for the script functionality
 N/A error_msg N/A ERROR: and run 'gen_edgerc %s' to generate the credential file
 section_name N/A N/A N/A sys exit error_msg N/A N/A hasattr config verbose N/A N/A debug N/A config verbose N/A N/A N/A config debug N/A config verbose N/A N/A debug True N/A debug N/A N/A httplib http_client N/A N/A N/A http_client HTTPConnection debuglevel 1 N/A N/A N/A logging basicConfig N/A N/A N/A N/A N/A logging getLogger setLevel N/A logging DEBUG N/A requests_log N/A N/A logging getLogger requests.packages.urllib3 N/A N/A N/A requests_log setLevel N/A logging DEBUG N/A N/A requests_log propagate True N/A N/A session auth N/A EdgeGridAuth client_token N/A config client_token client_secret N/A config client_secret access_token N/A config access_token N/A N/A hasattr config headers N/A N/A N/A N/A N/A session headers update N/A config headers N/A baseurl N/A %s://%s/ N/A https N/A config host getResult N/A N/A endpoint parameters N/A None N/A N/A parameters N/A N/A parameter_string N/A N/A urllib urlencode parameters N/A path N/A N/A join N/A N/A endpoint ? parameter_string N/A N/A path endpoint N/A endpoint_result N/A N/A session get N/A urljoin baseurl path N/A N/A httpErrors N/A endpoint_result status_code path N/A N/A endpoint_result json N/A debug N/A N/A N/A N/A >>>
 N/A N/A json dumps N/A N/A endpoint_result json indent 2 
<<<
 N/A N/A N/A endpoint_result json N/A httpErrors N/A N/A status_code endpoint result N/A N/A N/A N/A status_code 403 N/A N/A error_msg N/A ERROR: Call to %s failed with a 403 result
 endpoint N/A error_msg ERROR: This indicates a problem with authorization.
 N/A error_msg ERROR: Please ensure that the credentials you created for this script
 N/A error_msg ERROR: have the necessary permissions in the Luna portal.
 N/A error_msg N/A ERROR: Problem details: %s
 N/A result N/A detail N/A N/A exit error_msg N/A N/A status_code N/A 400 401 N/A N/A error_msg N/A ERROR: Call to %s failed with a %s result
 N/A endpoint status_code N/A error_msg ERROR: This indicates a problem with authentication or headers.
 N/A error_msg ERROR: Please ensure that the .edgerc file is formatted correctly.
 N/A error_msg ERROR: If you still have issues, please use gen_edgerc.py to generate the credentials
 N/A error_msg N/A ERROR: Problem details: %s
 N/A result N/A detail N/A N/A exit error_msg N/A N/A status_code N/A 404 N/A N/A error_msg N/A ERROR: Call to %s failed with a %s result
 N/A endpoint status_code N/A error_msg ERROR: This means that the page does not exist as requested.
 N/A error_msg ERROR: Please ensure that the URL you're calling is correctly formatted
 N/A error_msg ERROR: or look at other examples to make sure yours matches.
 N/A error_msg N/A ERROR: Problem details: %s
 N/A result N/A detail N/A N/A exit error_msg N/A error_string None N/A N/A errorString result N/A N/A N/A result N/A errorString N/A N/A error_string N/A result N/A errorString N/A N/A key result N/A N/A N/A N/A type key str N/A N/A N/A N/A N/A type N/A N/A result N/A key N/A errorString str N/A N/A error_string N/A N/A result N/A key N/A errorString N/A error_string N/A N/A error_msg ERROR: Call caused a server fault.
 N/A error_msg ERROR: Please check the problem details for more information:
 N/A error_msg N/A ERROR: Problem details: %s
 error_string N/A N/A exit error_msg N/A getGroup N/A N/A N/A N/A N/A 
	Request the list of groups for the property.  Print out
	how many groups there are, then use the first group where
	the test property lives.

	 N/A N/A Requesting the list of groups for this property N/A groups_result N/A getResult /papi/v0/groups N/A N/A There are %s groups associated with the account: N/A len N/A N/A groups_result N/A groups N/A items N/A N/A     %s (%s) N/A N/A groups_result N/A accountName N/A groups_result N/A accountId N/A group N/A N/A N/A groups_result N/A groups N/A items N/A 0 N/A groupId N/A group N/A groupId N/A groupName N/A group N/A groupName N/A N/A N/A Using group %s (%s) N/A groupName groupId N/A contractId N/A N/A group N/A contractIds N/A 0 N/A N/A Using contract ID %s contractId N/A N/A N/A groupId contractId N/A getProperties N/A N/A Id propertyName N/A N/A N/A 
	Get the properties for the associated group/contract combination
	 N/A property_parameters N/A contractId groupId N/A Id N/A contract N/A Id N/A group N/A property_result N/A getResult /papi/v0/properties property_parameters N/A property_items N/A N/A property_result N/A properties N/A items N/A N/A Grabbing specific information about the %s property propertyName N/A 
	Just go ahead and iterate over the dictionary, we're just
	finding a particular property
	 N/A testproperty_item N/A N/A item property_items N/A N/A N/A N/A item N/A propertyName propertyName N/A N/A N/A testproperty_item item N/A N/A testproperty_item N/A N/A N/A   No %s found propertyName N/A N/A exit N/A N/A   Found the property %s propertyName N/A N/A     Name: %s N/A testproperty_item N/A propertyName N/A N/A     Latest Version: %s N/A testproperty_item N/A latestVersion N/A N/A     Property ID: %s N/A testproperty_item N/A propertyId N/A N/A     Group ID: %s N/A Id N/A group N/A N/A     Contract ID: %s N/A Id N/A contract N/A N/A N/A testproperty_item N/A propertyId N/A testproperty_item N/A latestVersion N/A getPropertyRules N/A N/A Id propertyVersion behaviorName N/A N/A N/A 
	Now we're going to grab the property rules for this guy
	 N/A N/A Retrieving property rules N/A path N/A /papi/v0/properties/%s/versions/%s/rules N/A N/A Id N/A property propertyVersion N/A rule_parameters N/A contractId groupId N/A Id N/A contract N/A Id N/A group N/A rule_result N/A getResult path rule_parameters N/A item N/A N/A rule_result N/A rules N/A behaviors N/A N/A N/A N/A item N/A name behaviorName N/A N/A N/A N/A Current status is %s N/A N/A item N/A options N/A enabled N/A rule_result N/A toggleOffOn N/A N/A value N/A N/A N/A switch_dict N/A on off off on N/A N/A value switch_dict N/A N/A N/A switch_dict N/A value N/A None N/A switchPropertyStatus N/A N/A Id propertyVersion behaviorName rules N/A N/A N/A 
	Now we're going to switch the prefetch rule for this guy
	 N/A Switching status, please be patient... N/A headers N/A Content-Type application/vnd.akamai.papirules.latest+json N/A N/A headers N/A Accept application/vnd.akamai.papirules.latest+json,application/problem+json,application/json N/A path N/A /papi/v0/properties/%s/versions/%s/rules N/A N/A Id N/A property propertyVersion N/A newBehaviors N/A N/A item N/A N/A rules N/A rules N/A behaviors N/A N/A N/A N/A item N/A name behaviorName N/A N/A N/A N/A newBehaviors append item N/A N/A N/A N/A item N/A options N/A enabled N/A toggleOffOn N/A N/A item N/A options N/A enabled N/A N/A N/A newBehaviors append item N/A N/A N/A rules N/A rules N/A behaviors newBehaviors N/A status_parameters N/A contractId groupId N/A Id N/A contract N/A Id N/A group N/A parameter_string N/A N/A urllib urlencode status_parameters N/A path N/A N/A join N/A N/A path ? parameter_string N/A create_result N/A N/A session put N/A urljoin baseurl path data N/A N/A json dumps rules headers headers N/A N/A N/A create_result status_code N/A N/A requests codes ok N/A N/A debug N/A N/A N/A N/A >>>
 N/A N/A json dumps N/A N/A create_result json indent 2 
<<<
 N/A N/A N/A create_result raise_for_status N/A N/A N/A __name__ __main__ N/A N/A Id N/A N/A testProperty developer.akamai.com N/A testRule prefetching N/A N/A N/A Id N/A group N/A Id N/A contract N/A getGroup N/A N/A N/A Id N/A property propertyVersion N/A getProperties Id testProperty N/A rules N/A getPropertyRules Id propertyVersion testRule N/A N/A N/A N/A hasattr config write N/A config write N/A N/A N/A switchPropertyStatus Id propertyVersion testRule rules N/A N/A getPropertyRules Id propertyVersion testRule