[docs]defget_capabilities(self,paths,token=None,accessor=None):"""Get the capabilities associated with a token. Supported methods: POST: /sys/capabilities-self. Produces: 200 application/json POST: /sys/capabilities. Produces: 200 application/json POST: /sys/capabilities-accessor. Produces: 200 application/json :param paths: Paths on which capabilities are being queried. :type paths: List[str] :param token: Token for which capabilities are being queried. :type token: str :param accessor: Accessor of the token for which capabilities are being queried. :type accessor: str :return: The JSON response of the request. :rtype: dict """params={"paths":paths,}iftokenandaccessor:raiseValueError("You can specify either token or accessor, not both.")eliftoken:# https://www.vaultproject.io/api/system/capabilities.htmlparams["token"]=tokenapi_path="/v1/sys/capabilities"elifaccessor:# https://www.vaultproject.io/api/system/capabilities-accessor.htmlparams["accessor"]=accessorapi_path="/v1/sys/capabilities-accessor"else:# https://www.vaultproject.io/api/system/capabilities-self.htmlapi_path="/v1/sys/capabilities-self"returnself._adapter.post(url=api_path,json=params,)