Skip to main content

proposals

Creates, updates, deletes, gets or lists a proposals resource.

Overview

Nameproposals
TypeResource
Idaws.managedblockchain.proposals

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
actionsobjectThe actions to carry out if a proposal is APPROVED. Applies only to Hyperledger Fabric.
arnstringThe 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_datestring (date-time)The date and time that the proposal was created.
descriptionstringThe description of the proposal.
expiration_datestring (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_idstringThe unique identifier of the network for which the proposal is made.
no_vote_countintegerThe current total of NO votes cast on the proposal by members.
outstanding_vote_countintegerThe 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_idstringThe unique identifier of the proposal.
proposed_by_member_idstringThe unique identifier of the member that created the proposal.
proposed_by_member_namestringThe name of the member that created the proposal. (pattern: <code>^(?!-|[0-9])(?!.-$)(?!.?--)[a-zA-Z0-9-]+$</code>)
statusstringThe 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)
tagsobjectTags 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_countintegerThe current total of YES votes cast on the proposal by members.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_proposalselectnetwork_id, proposal_id, regionReturns detailed information about a proposal. Applies only to Hyperledger Fabric.
list_proposalsselectnetwork_id, regionmaxResults, nextTokenReturns a list of proposals for the network. Applies only to Hyperledger Fabric.
create_proposalinsertnetwork_id, region, ClientRequestToken, MemberId, ActionsCreates 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_proposalexecnetwork_id, proposal_id, region, VoterMemberId, VoteCasts 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.

NameDatatypeDescription
network_idstringThe unique identifier of the network.
proposal_idstringThe unique identifier of the proposal.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of proposals to return.
nextTokenstringThe pagination token that indicates the next set of results to retrieve.

SELECT examples

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
;

INSERT examples

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
;

Lifecycle Methods

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 }}"
}'
;