summaryrefslogtreecommitdiffstats
path: root/third_party/python/taskcluster/taskcluster/aio/pulse.py
blob: 1ce4966427dce6fe5ada35b7c330a7d7d62988bf (plain)
1
2
3
4
5
6
7
8
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# coding=utf-8
#####################################################
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT #
#####################################################
# noqa: E128,E201
from .asyncclient import AsyncBaseClient
from .asyncclient import createApiClient
from .asyncclient import config
from .asyncclient import createTemporaryCredentials
from .asyncclient import createSession
_defaultConfig = config


class Pulse(AsyncBaseClient):
    """
    The taskcluster-pulse service, typically available at `pulse.taskcluster.net`
    manages pulse credentials for taskcluster users.

    A service to manage Pulse credentials for anything using
    Taskcluster credentials. This allows for self-service pulse
    access and greater control within the Taskcluster project.
    """

    classOptions = {
    }
    serviceName = 'pulse'
    apiVersion = 'v1'

    async def ping(self, *args, **kwargs):
        """
        Ping Server

        Respond without doing anything.
        This endpoint is used to check that the service is up.

        This method is ``stable``
        """

        return await self._makeApiCall(self.funcinfo["ping"], *args, **kwargs)

    async def listNamespaces(self, *args, **kwargs):
        """
        List Namespaces

        List the namespaces managed by this service.

        This will list up to 1000 namespaces. If more namespaces are present a
        `continuationToken` will be returned, which can be given in the next
        request. For the initial request, do not provide continuation token.

        This method gives output: ``v1/list-namespaces-response.json#``

        This method is ``experimental``
        """

        return await self._makeApiCall(self.funcinfo["listNamespaces"], *args, **kwargs)

    async def namespace(self, *args, **kwargs):
        """
        Get a namespace

        Get public information about a single namespace. This is the same information
        as returned by `listNamespaces`.

        This method gives output: ``v1/namespace.json#``

        This method is ``experimental``
        """

        return await self._makeApiCall(self.funcinfo["namespace"], *args, **kwargs)

    async def claimNamespace(self, *args, **kwargs):
        """
        Claim a namespace

        Claim a namespace, returning a connection string with access to that namespace
        good for use until the `reclaimAt` time in the response body. The connection
        string can be used as many times as desired during this period, but must not
        be used after `reclaimAt`.

        Connections made with this connection string may persist beyond `reclaimAt`,
        although it should not persist forever.  24 hours is a good maximum, and this
        service will terminate connections after 72 hours (although this value is
        configurable).

        The specified `expires` time updates any existing expiration times.  Connections
        for expired namespaces will be terminated.

        This method takes input: ``v1/namespace-request.json#``

        This method gives output: ``v1/namespace-response.json#``

        This method is ``experimental``
        """

        return await self._makeApiCall(self.funcinfo["claimNamespace"], *args, **kwargs)

    funcinfo = {
        "claimNamespace": {
            'args': ['namespace'],
            'input': 'v1/namespace-request.json#',
            'method': 'post',
            'name': 'claimNamespace',
            'output': 'v1/namespace-response.json#',
            'route': '/namespace/<namespace>',
            'stability': 'experimental',
        },
        "listNamespaces": {
            'args': [],
            'method': 'get',
            'name': 'listNamespaces',
            'output': 'v1/list-namespaces-response.json#',
            'query': ['limit', 'continuationToken'],
            'route': '/namespaces',
            'stability': 'experimental',
        },
        "namespace": {
            'args': ['namespace'],
            'method': 'get',
            'name': 'namespace',
            'output': 'v1/namespace.json#',
            'route': '/namespace/<namespace>',
            'stability': 'experimental',
        },
        "ping": {
            'args': [],
            'method': 'get',
            'name': 'ping',
            'route': '/ping',
            'stability': 'stable',
        },
    }


__all__ = ['createTemporaryCredentials', 'config', '_defaultConfig', 'createApiClient', 'createSession', 'Pulse']