Module isilon.api.discoverability
View Source
import attr
from isilon.api.base import BaseAPI
@attr.s(frozen=True)
class Discoverability(BaseAPI):
async def info(self, *args, **kwargs):
"""List activated capabilities."""
response = await self.base_request(
self.http.get, f"{self.url}/info", *args, **kwargs
)
json_response = await response.json()
return json_response
Classes
Discoverability
class Discoverability(
http: isilon.http.Http,
url,
credentials: isilon.creds.Credentials
)
View Source
class Discoverability(BaseAPI):
async def info(self, *args, **kwargs):
"""List activated capabilities."""
response = await self.base_request(
self.http.get, f"{self.url}/info", *args, **kwargs
)
json_response = await response.json()
return json_response
Ancestors (in MRO)
- isilon.api.base.BaseAPI
Class variables
API_VERSION
Methods
base_request
def base_request(
self,
fn,
url,
headers: dict = {},
*args,
**kwargs
)
View Source
async def base_request(self, fn, url, headers: dict = {}, *args, **kwargs):
headers = await self.get_token(headers)
response = await fn(url, headers=headers, *args, **kwargs)
return response
get_token
def get_token(
self,
headers: dict
) -> dict
View Source
async def get_token(self, headers: dict) -> dict:
token = await self.credentials.x_auth_token(self.url)
headers.update(token)
return headers
info
def info(
self,
*args,
**kwargs
)
List activated capabilities.
View Source
async def info(self, *args, **kwargs):
"""List activated capabilities."""
response = await self.base_request(
self.http.get, f"{self.url}/info", *args, **kwargs
)
json_response = await response.json()
return json_response