Skip to content

marketplace

MarketPlace

Bases: AtlassianRestAPI

Marketplace API wrapper.

Source code in server/vendor/atlassian/marketplace.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
class MarketPlace(AtlassianRestAPI):
    """Marketplace API wrapper."""

    def get_plugins_info(self, limit=10, offset=10):
        """
        Provide plugins info
        :param limit:
        :param offset:
        :return:
        """
        params = {}
        if offset:
            params["offset"] = offset
        if limit:
            params["limit"] = limit
        url = "rest/1.0/plugins"
        return (self.get(url, params=params) or {}).get("plugins")

    def get_vendors_info(self, limit=10, offset=10):
        """
        Provide vendors info
        :param limit:
        :param offset:
        :return:
        """
        params = {}
        if offset:
            params["offset"] = offset
        if limit:
            params["limit"] = limit
        url = "rest/1.0/vendors"
        return (self.get(url, params=params) or {}).get("vendors")

    def get_application_info(self, limit=10, offset=10):
        """
        Information about applications
        :param limit:
        :param offset:
        :return:
        """
        params = {}
        if offset:
            params["offset"] = offset
        if limit:
            params["limit"] = limit
        url = "rest/2/applications"
        return self.get(url, params=params)

    def get_app_versions(self, add_on_key, application=None):
        """
        Get a list of versions for the specified app.
        :param add_on_key: The unique identifier for this app,
                            for example "com.atlassian.confluence.plugins.confluence-questions"
        :param application: Only returns apps compatible with this application
        :return:
        """
        params = {}
        if application:
            params["application"] = application
        url = "rest/2/addons/{addonKey}/versions".format(addonKey=add_on_key)
        return self.get(url, params=params)

    def get_app_reviews(self, add_on_key, sort=None):
        """
        Get a list of reviews for the specified app.
        :param add_on_key: The unique identifier for this app,
                            for example "com.atlassian.confluence.plugins.confluence-questions"
        :param sort: Specifies the review sort order
                     Valid values: helpful, recent
        :return:
        """
        url = "rest/2/addons/{addonKey}/reviews".format(addonKey=add_on_key)
        params = {}
        if sort:
            params["sort"] = sort
        return self.get(url, params=params)

get_app_reviews(add_on_key, sort=None)

Get a list of reviews for the specified app. :param add_on_key: The unique identifier for this app, for example "com.atlassian.confluence.plugins.confluence-questions" :param sort: Specifies the review sort order Valid values: helpful, recent :return:

Source code in server/vendor/atlassian/marketplace.py
71
72
73
74
75
76
77
78
79
80
81
82
83
84
def get_app_reviews(self, add_on_key, sort=None):
    """
    Get a list of reviews for the specified app.
    :param add_on_key: The unique identifier for this app,
                        for example "com.atlassian.confluence.plugins.confluence-questions"
    :param sort: Specifies the review sort order
                 Valid values: helpful, recent
    :return:
    """
    url = "rest/2/addons/{addonKey}/reviews".format(addonKey=add_on_key)
    params = {}
    if sort:
        params["sort"] = sort
    return self.get(url, params=params)

get_app_versions(add_on_key, application=None)

Get a list of versions for the specified app. :param add_on_key: The unique identifier for this app, for example "com.atlassian.confluence.plugins.confluence-questions" :param application: Only returns apps compatible with this application :return:

Source code in server/vendor/atlassian/marketplace.py
57
58
59
60
61
62
63
64
65
66
67
68
69
def get_app_versions(self, add_on_key, application=None):
    """
    Get a list of versions for the specified app.
    :param add_on_key: The unique identifier for this app,
                        for example "com.atlassian.confluence.plugins.confluence-questions"
    :param application: Only returns apps compatible with this application
    :return:
    """
    params = {}
    if application:
        params["application"] = application
    url = "rest/2/addons/{addonKey}/versions".format(addonKey=add_on_key)
    return self.get(url, params=params)

get_application_info(limit=10, offset=10)

Information about applications :param limit: :param offset: :return:

Source code in server/vendor/atlassian/marketplace.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
def get_application_info(self, limit=10, offset=10):
    """
    Information about applications
    :param limit:
    :param offset:
    :return:
    """
    params = {}
    if offset:
        params["offset"] = offset
    if limit:
        params["limit"] = limit
    url = "rest/2/applications"
    return self.get(url, params=params)

get_plugins_info(limit=10, offset=10)

Provide plugins info :param limit: :param offset: :return:

Source code in server/vendor/atlassian/marketplace.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def get_plugins_info(self, limit=10, offset=10):
    """
    Provide plugins info
    :param limit:
    :param offset:
    :return:
    """
    params = {}
    if offset:
        params["offset"] = offset
    if limit:
        params["limit"] = limit
    url = "rest/1.0/plugins"
    return (self.get(url, params=params) or {}).get("plugins")

get_vendors_info(limit=10, offset=10)

Provide vendors info :param limit: :param offset: :return:

Source code in server/vendor/atlassian/marketplace.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def get_vendors_info(self, limit=10, offset=10):
    """
    Provide vendors info
    :param limit:
    :param offset:
    :return:
    """
    params = {}
    if offset:
        params["offset"] = offset
    if limit:
        params["limit"] = limit
    url = "rest/1.0/vendors"
    return (self.get(url, params=params) or {}).get("vendors")