1# coding=utf-8 2##################################################### 3# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT # 4##################################################### 5# noqa: E128,E201 6from .client import BaseClient 7from .client import createApiClient 8from .client import config 9from .client import createTemporaryCredentials 10from .client import createSession 11_defaultConfig = config 12 13 14class PurgeCache(BaseClient): 15 """ 16 The purge-cache service is responsible for publishing a pulse 17 message for workers, so they can purge cache upon request. 18 19 This document describes the API end-point for publishing the pulse 20 message. This is mainly intended to be used by tools. 21 """ 22 23 classOptions = { 24 } 25 serviceName = 'purge-cache' 26 apiVersion = 'v1' 27 28 def ping(self, *args, **kwargs): 29 """ 30 Ping Server 31 32 Respond without doing anything. 33 This endpoint is used to check that the service is up. 34 35 This method is ``stable`` 36 """ 37 38 return self._makeApiCall(self.funcinfo["ping"], *args, **kwargs) 39 40 def purgeCache(self, *args, **kwargs): 41 """ 42 Purge Worker Cache 43 44 Publish a purge-cache message to purge caches named `cacheName` with 45 `provisionerId` and `workerType` in the routing-key. Workers should 46 be listening for this message and purge caches when they see it. 47 48 This method takes input: ``v1/purge-cache-request.json#`` 49 50 This method is ``stable`` 51 """ 52 53 return self._makeApiCall(self.funcinfo["purgeCache"], *args, **kwargs) 54 55 def allPurgeRequests(self, *args, **kwargs): 56 """ 57 All Open Purge Requests 58 59 This is useful mostly for administors to view 60 the set of open purge requests. It should not 61 be used by workers. They should use the purgeRequests 62 endpoint that is specific to their workerType and 63 provisionerId. 64 65 This method gives output: ``v1/all-purge-cache-request-list.json#`` 66 67 This method is ``stable`` 68 """ 69 70 return self._makeApiCall(self.funcinfo["allPurgeRequests"], *args, **kwargs) 71 72 def purgeRequests(self, *args, **kwargs): 73 """ 74 Open Purge Requests for a provisionerId/workerType pair 75 76 List of caches that need to be purged if they are from before 77 a certain time. This is safe to be used in automation from 78 workers. 79 80 This method gives output: ``v1/purge-cache-request-list.json#`` 81 82 This method is ``stable`` 83 """ 84 85 return self._makeApiCall(self.funcinfo["purgeRequests"], *args, **kwargs) 86 87 funcinfo = { 88 "allPurgeRequests": { 89 'args': [], 90 'method': 'get', 91 'name': 'allPurgeRequests', 92 'output': 'v1/all-purge-cache-request-list.json#', 93 'query': ['continuationToken', 'limit'], 94 'route': '/purge-cache/list', 95 'stability': 'stable', 96 }, 97 "ping": { 98 'args': [], 99 'method': 'get', 100 'name': 'ping', 101 'route': '/ping', 102 'stability': 'stable', 103 }, 104 "purgeCache": { 105 'args': ['provisionerId', 'workerType'], 106 'input': 'v1/purge-cache-request.json#', 107 'method': 'post', 108 'name': 'purgeCache', 109 'route': '/purge-cache/<provisionerId>/<workerType>', 110 'stability': 'stable', 111 }, 112 "purgeRequests": { 113 'args': ['provisionerId', 'workerType'], 114 'method': 'get', 115 'name': 'purgeRequests', 116 'output': 'v1/purge-cache-request-list.json#', 117 'query': ['since'], 118 'route': '/purge-cache/<provisionerId>/<workerType>', 119 'stability': 'stable', 120 }, 121 } 122 123 124__all__ = ['createTemporaryCredentials', 'config', '_defaultConfig', 'createApiClient', 'createSession', 'PurgeCache'] 125