Skip to content

Commit

Permalink
Added MSL Origin Fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
achuthakamai committed Oct 17, 2024
1 parent 732dc37 commit 569e4d6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyakamai.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: pyakamai
Version: 2.40.4
Version: 2.40.6
Summary: A Boto3 like SDK for Akamai
Home-page: https://github.com/Achuthananda/pyakamai
Author: Achuthananda M P
Expand Down
Binary file modified pyakamai/__pycache__/akamaiproperty.cpython-312.pyc
Binary file not shown.
28 changes: 25 additions & 3 deletions pyakamai/akamaiproperty.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ def getOrigins(self,version):
if behavior["behavior"]["name"] == 'origin':
if behavior["behavior"]["options"]['originType'] == 'CUSTOMER':
originlist.append(behavior["behavior"]["options"]['hostname'])
elif behavior["behavior"]["options"]['originType'] == 'MEDIA_SERVICE_LIVE':
originlist.append(behavior["behavior"]["options"]['mslorigin'])
else:
originlist.append(behavior["behavior"]["options"]['netStorage']['downloadDomainName'])
originlist = list(dict.fromkeys(originlist))
Expand Down Expand Up @@ -710,6 +712,7 @@ def getGroups(self):
else:
status,getgroupJson = self._prdHttpCaller.getResult(ep)
print(getgroupJson)
return getgroupJson
for items in getgroupJson["groups"]["items"]:
groupsList.append(items["groupId"])
return groupsList
Expand Down Expand Up @@ -796,19 +799,38 @@ def bulkSearch(self,jsonPathMatch,jsonPathQualifiers=None):
except Exception as e:
return []

def getallProperties(self):

def getallProperties1(self):
propertylist = []
groupIds = self.getGroups()
contractIds = self.getContracts()
for ctr in contractIds:
print("Fetching Properties from Contract {}".format(ctr))
for grp in groupIds:
print("Fetching Properties from Group {}".format(grp))
property_list = self.getPropertiesofGroup(ctr,grp)
#print(property_list)
print(property_list)
if len(property_list) != 0:
for x in property_list:
propertylist.append(x)
print("*"*80)
return propertylist


def getallProperties(self):
propertylist = []
groupJson = self.getGroups()
for items in groupJson["groups"]["items"]:
print("Fetching from group {}".format(items["groupId"]))
for ctrId in items["contractIds"]:
print("Fetching from Contract {}".format(ctrId))
property_list = self.getPropertiesofGroup(ctrId,items["groupId"])
print(property_list)
if len(property_list) != 0:
for x in property_list:
propertylist.append(x)
print("*"*80)
return propertylist

def getCustomBehaviors(self):
cbList = {}
ep = '/papi/v1/custom-behaviors'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setuptools.setup(
name=PACKAGE_NAME,
version='2.40.5',
version='2.40.7',
author="Achuthananda M P",
author_email="achuthadivine@gmail.com",
description="A Boto3 like SDK for Akamai",
Expand Down

0 comments on commit 569e4d6

Please sign in to comment.