proposals
Creates, updates, deletes, gets or lists a proposals resource.
Overview
| Name | proposals |
| Type | Resource |
| Id | aws.managedblockchain.proposals |
Fields
The following fields are returned by SELECT queries:
- get_proposal
- list_proposals
| Name | Datatype | Description |
|---|---|---|
actions | object | The actions to carry out if a proposal is APPROVED. Applies only to Hyperledger Fabric. |
arn | string | The Amazon Resource Name (ARN) of the proposal. For more information about ARNs and their format, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference. (pattern: <code>^arn:.+:.+:.+:.+:.+</code>) |
creation_date | string (date-time) | The date and time that the proposal was created. |
description | string | The description of the proposal. |
expiration_date | string (date-time) | The date and time that the proposal expires. This is the CreationDate plus the ProposalDurationInHours that is specified in the ProposalThresholdPolicy. After this date and time, if members haven't cast enough votes to determine the outcome according to the voting policy, the proposal is EXPIRED and Actions aren't carried out. |
network_id | string | The unique identifier of the network for which the proposal is made. |
no_vote_count | integer | The current total of NO votes cast on the proposal by members. |
outstanding_vote_count | integer | The number of votes remaining to be cast on the proposal by members. In other words, the number of members minus the sum of YES votes and NO votes. |
proposal_id | string | The unique identifier of the proposal. |
proposed_by_member_id | string | The unique identifier of the member that created the proposal. |
proposed_by_member_name | string | The name of the member that created the proposal. (pattern: <code>^(?!-|[0-9])(?!.-$)(?!.?--)[a-zA-Z0-9-]+$</code>) |
status | string | The status of the proposal. Values are as follows: IN_PROGRESS - The proposal is active and open for member voting. APPROVED - The proposal was approved with sufficient YES votes among members according to the VotingPolicy specified for the Network. The specified proposal actions are carried out. REJECTED - The proposal was rejected with insufficient YES votes among members according to the VotingPolicy specified for the Network. The specified ProposalActions aren't carried out. EXPIRED - Members didn't cast the number of votes required to determine the proposal outcome before the proposal expired. The specified ProposalActions aren't carried out. ACTION_FAILED - One or more of the specified ProposalActions in a proposal that was approved couldn't be completed because of an error. The ACTION_FAILED status occurs even if only one ProposalAction fails and other actions are successful. (IN_PROGRESS, APPROVED, REJECTED, EXPIRED, ACTION_FAILED) |
tags | object | Tags assigned to the proposal. Each tag consists of a key and optional value. For more information about tags, see Tagging Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. |
yes_vote_count | integer | The current total of YES votes cast on the proposal by members. |
| Name | Datatype | Description |
|---|---|---|
next_token | string | The pagination token that indicates the next set of results to retrieve. |
proposals | array | The summary of each proposal made on the network. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_proposal | select | network_id, proposal_id, region | Returns detailed information about a proposal. Applies only to Hyperledger Fabric. | |
list_proposals | select | network_id, region | maxResults, nextToken | Returns a list of proposals for the network. Applies only to Hyperledger Fabric. |
create_proposal | insert | network_id, region, ClientRequestToken, MemberId, Actions | Creates a proposal for a change to the network that other members of the network can vote on, for example, a proposal to add a new member to the network. Any member can create a proposal. Applies only to Hyperledger Fabric. | |
vote_on_proposal | exec | network_id, proposal_id, region, VoterMemberId, Vote | Casts a vote for a specified ProposalId on behalf of a member. The member to vote as, specified by VoterMemberId, must be in the same Amazon Web Services account as the principal that calls the action. Applies only to Hyperledger Fabric. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
network_id | string | The unique identifier of the network. |
proposal_id | string | The unique identifier of the proposal. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of proposals to return. |
nextToken | string | The pagination token that indicates the next set of results to retrieve. |
SELECT examples
- get_proposal
- list_proposals
Returns detailed information about a proposal. Applies only to Hyperledger Fabric.
SELECT
actions,
arn,
creation_date,
description,
expiration_date,
network_id,
no_vote_count,
outstanding_vote_count,
proposal_id,
proposed_by_member_id,
proposed_by_member_name,
status,
tags,
yes_vote_count
FROM aws.managedblockchain.proposals
WHERE network_id = '{{ network_id }}' -- required
AND proposal_id = '{{ proposal_id }}' -- required
AND region = '{{ region }}' -- required
;
Returns a list of proposals for the network. Applies only to Hyperledger Fabric.
SELECT
next_token,
proposals
FROM aws.managedblockchain.proposals
WHERE network_id = '{{ network_id }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_proposal
- Manifest
Creates a proposal for a change to the network that other members of the network can vote on, for example, a proposal to add a new member to the network. Any member can create a proposal. Applies only to Hyperledger Fabric.
INSERT INTO aws.managedblockchain.proposals (
ClientRequestToken,
MemberId,
Actions,
Description,
Tags,
network_id,
region
)
SELECT
'{{ ClientRequestToken }}' /* required */,
'{{ MemberId }}' /* required */,
'{{ Actions }}' /* required */,
'{{ Description }}',
'{{ Tags }}',
'{{ network_id }}',
'{{ region }}'
RETURNING
proposal_id
;
# Description fields are for documentation purposes
- name: proposals
props:
- name: network_id
value: "{{ network_id }}"
description: Required parameter for the proposals resource.
- name: region
value: "{{ region }}"
description: Required parameter for the proposals resource.
- name: ClientRequestToken
value: "{{ ClientRequestToken }}"
- name: MemberId
value: "{{ MemberId }}"
- name: Actions
description: |
The actions to carry out if a proposal is APPROVED. Applies only to Hyperledger Fabric.
value:
Invitations:
- Principal: "{{ Principal }}"
Removals:
- MemberId: "{{ MemberId }}"
- name: Description
value: "{{ Description }}"
- name: Tags
value: "{{ Tags }}"
Lifecycle Methods
- vote_on_proposal
Casts a vote for a specified ProposalId on behalf of a member. The member to vote as, specified by VoterMemberId, must be in the same Amazon Web Services account as the principal that calls the action. Applies only to Hyperledger Fabric.
EXEC aws.managedblockchain.proposals.vote_on_proposal
@network_id='{{ network_id }}' --required,
@proposal_id='{{ proposal_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"VoterMemberId": "{{ VoterMemberId }}",
"Vote": "{{ Vote }}"
}'
;