Page tree
Skip to end of metadata
Go to start of metadata

App bundle lists can be created, edited and viewed using the api.  When you have created an app bundle list, you can attach that list to a demand or supply tag for targeting. 

Creating an App Bundle List

SDK

Use tab completion with SDK to auto-complete function names or show field options!

In [1]: import springserve
 
In [2]: app_bundle_list = springserve.app_bundle_lists.new({"name":"My Test App Bundle List"})
 
In [3]: print app_bundle_list.ok, app_bundle_list.id
True 9

REST API

POST /api/v0/app_bundle_lists

Headers

Content-Type application/json
Authorization "yourAuthToken"

Body (example)

{
    "name": "My App Bundle List",
    "description": "My description"
}

Required parameters: name

Response

Status code 200

{
    "account_id": 1,
    "active": True,
    "created_at": "2018-02-20T14:05:34.029Z",
 	"description": "My description",
 	"id": 9,
	"name": "My Test App Bundle List",
    "partial_match": False
}


Get an App Bundle List

SDK

In [1]: app_bundle_list = springserve.app_bundle_lists.get(9)
 
In [2]: print app_bundle_list.name
"My Test App Bundle List"

REST API

GET /api/v0/app_bundle_lists/<id>

Headers

Content-Type application/json
Authorization "yourAuthToken"

Response

Status code 200

{
    "account_id": 1,
    "active": True,
    "created_at": "2018-02-20T14:05:34.029Z",
 	"description": "My description",
 	"id": 9,
	"name": "My Test App Bundle List",
    "partial_match": False
}

Add App Bundles

SDK

In [1]:  app_bundle_list = springserve.app_lists.get(9)

In [2]:  add = app_bundle_list.add_bundles(['app1', 'app2'])

In [3]: print add.ok
True

REST API

POST /api/v0/app_bundle_lists/<id>/app_bundles/bulk_create

Headers

Content-Type application/json
Authorization "yourAuthToken"

Body (example)

{
	"app_bundles": ["app1", "app2"]
}

Response

Status code 200

{"created": True}

Get App Bundles in App Bundle List

SDK

In [15]: resp = app_bundle_list.get_bundles() 

In [16]: for bundle in resp:
   ....:     print bundle.app_bundle
   ....:     
app1
app2

REST API

GET /api/v0/app_bundle_lists/<id>/app_bundles

Headers

Content-Type application/json
Authorization "yourAuthToken"


Response (note you need to pagenate)

Status code 200

[
	{"app_bundle": "app1"}, 
    {"app_bundle": "app2"}
]

Remove App Bundles

SDK

 In [13]: app_bundle_list = springserve.app_bundle_lists.get(9)

 In [14]: resp = app_bundle_list.remove_bundles(['app2'])


 In [15]: resp.ok
 Out [15]: True

 In [16]: print resp.deleted
 True

REST API

DELETE /api/v0/app_bundle_lists/<id>/app_bundles/bulk_delete

Headers

Content-Type application/json
Authorization "yourAuthToken"

Body (example)


{
	"app_bundles": ["app2"]
}

Response (note you need to pagenate)

Status code 200

{"deleted": True}

Attach to a Demand or Supply Tag

To attach an app bundle list to a supply or demand tag you must set the following fields on a supply or demand tag

  • app_bundle_list_ids → this is a list of app bundle list ids that you want to target on the supply or demand tag
  • app_bundle_targeting → Whether or not to treat it like a 'White List' or 'Black List'

SDK

In [18]: tag = springserve.demand_tags.get(2)

In [19]: tag.app_bundle_list_ids.append(9)

In [20]: tag.app_bundle_targeting = "White List"

In [21]: print tag.save().ok
True

REST API

See documentation on the Supply and Demand Tag APIs


  • No labels