@@ -77,15 +77,17 @@ def get_instance(self, instance_key):
7777
7878 def get_manifest (self ):
7979 raw_data = self .client ._perform_json ("GET" , "/apps/%s/" % self .app_id )
80- return DSSAppManifest (self .client , raw_data )
80+ project_key = self .app_id [8 :] if self .app_id .startswith ('PROJECT_' ) else None
81+ return DSSAppManifest (self .client , raw_data , project_key )
8182
8283
8384class DSSAppManifest (object ):
8485
85- def __init__ (self , client , raw_data ):
86+ def __init__ (self , client , raw_data , project_key = None ):
8687 """The manifest for an app. Do not create this class directly"""
8788 self .client = client
8889 self .raw_data = raw_data
90+ self .project_key = project_key
8991
9092 def get_raw (self ):
9193 return self .raw_data
@@ -97,6 +99,13 @@ def get_runnable_scenarios(self):
9799 """Return the scenario identifiers that are declared as actions for this app"""
98100 return [x ["scenarioId" ] for x in self .get_all_actions () if x ["type" ] == "SCENARIO_RUN" ]
99101
102+ def save (self ):
103+ """Saves the changes to this manifest object back to the template project"""
104+ if self .project_key is None :
105+ raise Exception ("This manifest object wasn't created from a project, cannot be saved back" )
106+ self .client ._perform_empty ("PUT" , "/projects/%s/app-manifest" % self .project_key , body = self .raw_data )
107+
108+
100109class DSSAppInstance (object ):
101110
102111 def __init__ (self , client , project_key ):
0 commit comments