The Azure Blockchain Workbench REST API is a Workbench extensibility point, which allows developers to create and manage blockchain applications, manage users and organizations within a consortium, integrate blockchain applications into services and platforms, perform transactions on a blockchain, and retrieve transactional and contract data from a blockchain.
This Python package is automatically generated by the Swagger Codegen project:
- API version: v1
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen
The generated source was augmented in two ways -
The generated Workflow type included a self import that caused challenges and was remediated.
Microsoft's ADAL library was added to support for Python to provide authenticated access to the API using the following code.
context = adal.AuthenticationContext(authority_url,api_version=None)
token = context.acquire_token_with_client_credentials(client_id,client_id,client_secret)
api_client = ApiClient();
bearer_token = "Bearer "+token['accessToken']
api_client.set_default_header('Authorization',bearer_token)
api_user = swagger_client.UsersApi(api_client)
me = api_user.me_get()
pprint(me)
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import swagger_client
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import swagger_client
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.ApplicationsApi()
application_id = 'application_id_example' # str | The id of the application.
try:
#
api_instance.application_delete(application_id)
except ApiException as e:
print("Exception when calling ApplicationsApi->application_delete: %s\n" % e)
All URIs are relative to https://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
ApplicationsApi | application_delete | DELETE /api/v1/applications/{applicationID} | |
ApplicationsApi | application_disable | PATCH /api/v1/applications/{applicationID}/disable | |
ApplicationsApi | application_enable | PATCH /api/v1/applications/{applicationID}/enable | |
ApplicationsApi | application_get | GET /api/v1/applications/{applicationId} | |
ApplicationsApi | applications_get | GET /api/v1/applications | |
ApplicationsApi | applications_post | POST /api/v1/applications | |
ApplicationsApi | contract_code_delete | DELETE /api/v1/applications/contractCode/{contractCodeId} | |
ApplicationsApi | contract_code_get | GET /api/v1/applications/contractCode/{contractCodeId} | |
ApplicationsApi | contract_code_post | POST /api/v1/applications/{applicationId}/contractCode | |
ApplicationsApi | contract_codes_get | GET /api/v1/applications/{applicationID}/contractCode | |
ApplicationsApi | role_assignment_delete | DELETE /api/v1/applications/{applicationId}/roleAssignments/{roleAssignmentId} | |
ApplicationsApi | role_assignment_get | GET /api/v1/applications/{applicationId}/roleAssignments/{roleAssignmentId} | |
ApplicationsApi | role_assignments_get | GET /api/v1/applications/{applicationId}/roleAssignments | |
ApplicationsApi | role_assignments_post | POST /api/v1/applications/{applicationId}/roleAssignments | |
ApplicationsApi | workflow_get | GET /api/v1/applications/workflows/{workflowId} | |
ApplicationsApi | workflows_get | GET /api/v1/applications/{applicationId}/workflows | |
CapabilitiesApi | can_create_contract | GET /api/v1/capabilities/canCreateContract/{workflowId} | |
CapabilitiesApi | capabilities_get | GET /api/v1/capabilities | |
CheckersApi | check_application_post | POST /api/v1/checkers/checkApplication | Check validity of application configuration for Workbench |
CheckersApi | check_contract_code_post | POST /api/v1/checkers/checkContractCode | Check validity of application ledger implementation for Workbench |
ConnectionsApi | block_get | GET /api/v1/ledgers/connections/{connectionId}/blocks/{blockId} | |
ConnectionsApi | blocks_get | GET /api/v1/ledgers/connections/{connectionId}/blocks | |
ConnectionsApi | connection_get | GET /api/v1/ledgers/connections/{connectionId} | |
ConnectionsApi | connections_get | GET /api/v1/ledgers/connections | |
ConnectionsApi | transaction_get | GET /api/v1/ledgers/connections/{connectionId}/transactions/{transactionId} | |
ConnectionsApi | transactions_get | GET /api/v1/ledgers/connections/{connectionId}/transactions | |
ContractsApi | contract_action_get | GET /api/v1/contracts/{contractId}/actions/{actionId} | |
ContractsApi | contract_action_post | POST /api/v1/contracts/{contractId}/actions | |
ContractsApi | contract_actions_get | GET /api/v1/contracts/{contractId}/actions | |
ContractsApi | contract_get | GET /api/v1/contracts/{contractId} | |
ContractsApi | contract_post | POST /api/v1/contracts | |
ContractsApi | contracts_get | GET /api/v1/contracts | |
GraphProxyApi | graph_proxy_users_get | GET /api/v1/graph-proxy/{version}/users | Get Users from AAD Graph |
LedgersApi | ledgers_get | GET /api/v1/ledgers | |
UsersApi | me_get | GET /api/v1/users/me | |
UsersApi | user_delete | DELETE /api/v1/users/{userID} | |
UsersApi | user_get | GET /api/v1/users/{userID} | |
UsersApi | users_get | GET /api/v1/users | Get Users |
UsersApi | users_post | POST /api/v1/users |
- Application
- ApplicationList
- ApplicationRole
- Block
- BlockList
- Capabilities
- Connection
- ConnectionList
- ContentResult
- Contract
- ContractAction
- ContractActionParameter
- ContractCode
- ContractCodeList
- ContractList
- ContractProperty
- EntityTagHeaderValue
- FileStreamResult
- IFormFile
- Ledger
- LedgerActionOutput
- LedgerList
- Me
- RoleAssignment
- RoleAssignmentInput
- RoleAssignmentList
- Stream
- StringSegment
- Transaction
- TransactionList
- User
- UserChainMapping
- UserInput
- UserList
- Workflow
- WorkflowActionInput
- WorkflowDataType
- WorkflowFunction
- WorkflowFunctionParameter
- WorkflowList
- WorkflowProperty
- WorkflowState
- WorkflowStateTransition
- WorkflowStateTransitionList
All endpoints do not require authorization.