Skip to content

Commit 20e9d3f

Browse files
committed
New CLI examples
1 parent 016a6c3 commit 20e9d3f

47 files changed

Lines changed: 1080 additions & 99 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

awscli/examples/codeguru-reviewer/associate-repository-bitbucket.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**To create a Bitbucket repository association**
2+
3+
The following ``associate-repository`` example creates a respository association using an existing Bitbucket repository. ::
4+
5+
aws codeguru-reviewer associate-repository \
6+
--repository 'Bitbucket={Owner=sample-owner, Name=mySampleRepo, ConnectionArn=arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 }'
7+
8+
Output::
9+
10+
{ "RepositoryAssociation": { "ProviderType": "Bitbucket", "Name": "mySampleRepo", "LastUpdatedTimeStamp": 1596216896.979, "AssociationId": "association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "CreatedTimeStamp": 1596216896.979, "ConnectionArn": "arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "State": "Associating", "StateReason": "Pending Repository Association", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Owner": "sample-owner" } }
11+
12+
For more information, see `AssociateRepository<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_AssociateRepository.html>`__ in the *Amazon DevOps Guru API Reference*.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
**To create an AWS CodeCommit repository association**
2+
3+
The following ``associate-repository`` example creates a respository association using an existing AWS CodeCommit repository. ::
4+
5+
aws codeguru-reviewer associate-repository \
6+
--repository CodeCommit={Name=mySampleRepo}
7+
8+
Output::
9+
10+
{
11+
"RepositoryAssociation": {
12+
"AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
13+
"Name": "My-ecs-beta-repo",
14+
"LastUpdatedTimeStamp": 1595634764.029,
15+
"ProviderType": "CodeCommit",
16+
"CreatedTimeStamp": 1595634764.029,
17+
"Owner": "544120495673",
18+
"State": "Associating",
19+
"StateReason": "Pending Repository Association",
20+
"AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:544120495673:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
21+
}
22+
}
23+
24+
For more information, see `AssociateRepository<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_AssociateRepository.html>`__ in the *Amazon DevOps Guru API Reference*

awscli/examples/codeguru-reviewer/associate-repository-github-enterprise.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**To create a GitHub Enterprise repository association**
2+
3+
The following ``associate-repository`` example creates a respository association using an existing GitHub Enterprise repository. ::
4+
5+
aws codeguru-reviewer associate-repository \
6+
--repository 'GitHubEnterpriseServer={Owner=sample-owner, Name=mySampleRepo, ConnectionArn=arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 }'
7+
8+
Output::
9+
10+
{ "RepositoryAssociation": { "ProviderType": "GitHubEnterpriseServer", "Name": "mySampleRepo", "LastUpdatedTimeStamp": 1596216896.979, "AssociationId": "association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "CreatedTimeStamp": 1596216896.979, "ConnectionArn": "arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "State": "Associating", "StateReason": "Pending Repository Association", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Owner": "sample-owner" } }
11+
12+
For more information, see `AssociateRepository<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_AssociateRepository.html>`__ in the *Amazon DevOps Guru API Reference*
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
**To return information about a repository association**
2+
3+
The following ``describe-repository-association`` example returns information about a repository association that uses a GitHub Enterprise repository and is in the ``Associated`` state. ::
4+
5+
aws codeguru-reviewer describe-repository-association \
6+
--association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
7+
8+
Output::
9+
10+
{
11+
"RepositoryAssociation": {
12+
"AssociationId": "b822717e-0711-4e8a-bada-0e738289c75e",
13+
"Name": "mySampleRepo",
14+
"LastUpdatedTimeStamp": 1588102637.649,
15+
"ProviderType": "GitHub",
16+
"CreatedTimeStamp": 1588102615.636,
17+
"Owner": "sample-owner",
18+
"State": "Associated",
19+
"StateReason": "Pull Request Notification configuration successful",
20+
"AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
21+
}
22+
}
23+
24+
For more information, see `DescribeRepositoryAssociation<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRepositoryAssociation.html>`__ in the *Amazon DevOps Guru API Reference*

awscli/examples/codeguru-reviewer/describe-repository-association-disassociating.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**To return information about a repository association**
2+
3+
The following ``describe-repository-association`` example returns information about a repository association that uses a GitHub Enterprise repository and is in the ``Disassociating`` state. ::
4+
5+
aws codeguru-reviewer describe-repository-association \
6+
--association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
7+
8+
Output::
9+
10+
{ "RepositoryAssociation": { "ProviderType": "GitHubEnterpriseServer", "Name": "mySampleRepo", "LastUpdatedTimeStamp": 1596217036.892, "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "CreatedTimeStamp": 1596216896.979, "ConnectionArn": "arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "State": "Disassociating", "StateReason": "Source code access removal in progress", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Owner": "sample-owner" } }
11+
12+
For more information, see `DescribeRepositoryAssociation<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRepositoryAssociation.html>`__ in the *Amazon DevOps Guru API Reference*.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**To return information about a repository association**
2+
3+
The following ``describe-repository-association`` example returns information about a repository association that uses a GitHub Enterprise repository and is in the ``Failed`` state. ::
4+
5+
aws codeguru-reviewer describe-repository-association \
6+
--association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
7+
8+
Output::
9+
10+
{
11+
"RepositoryAssociation": {
12+
"ProviderType": "GitHubEnterpriseServer",
13+
"Name": "mySampleRepo",
14+
"LastUpdatedTimeStamp": 1596217036.892,
15+
"AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
16+
"CreatedTimeStamp": 1596216896.979,
17+
"ConnectionArn": "arn:aws:codestar-connections:us-west-2:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
18+
"State": "Failed",
19+
"StateReason": "Failed, Please retry.",
20+
"AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
21+
"Owner": "sample-owner"
22+
}
23+
}
24+
25+
For more information, see `DescribeRepositoryAssociation<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRepositoryAssociation.html>`__ in the *Amazon DevOps Guru API Reference*.

awscli/examples/codeguru-reviewer/list-code-reviews.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**To list code reviews created in your AWS account in the last 90 days.**
2+
3+
The following ``list-code-reviews`` example lists the code reviews created in the last 90 days using pull requests. ::
4+
5+
aws codeguru-reviewer list-code-reviews \
6+
--type PullRequest
7+
8+
Output::
9+
10+
{ "CodeReviewSummaries": [ { "LastUpdatedTimeStamp": 1588897288.054, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProviderType": "GitHub", "PullRequestId": "5", "MetricsSummary": { "MeteredLinesOfCodeCount": 24, "FindingsCount": 1 }, "CreatedTimeStamp": 1588897068.512, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588869793.263, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "ProviderType": "GitHub", "PullRequestId": "4", "MetricsSummary": { "MeteredLinesOfCodeCount": 29, "FindingsCount": 0 }, "CreatedTimeStamp": 1588869575.949, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588870511.211, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "ProviderType": "GitHub", "PullRequestId": "4", "MetricsSummary": { "MeteredLinesOfCodeCount": 2, "FindingsCount": 0 }, "CreatedTimeStamp": 1588870292.425, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588118522.452, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE44444", "ProviderType": "GitHub", "PullRequestId": "3", "MetricsSummary": { "MeteredLinesOfCodeCount": 29, "FindingsCount": 0 }, "CreatedTimeStamp": 1588118301.131, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE44444", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588112205.207, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE55555", "ProviderType": "GitHub", "PullRequestId": "2", "MetricsSummary": { "MeteredLinesOfCodeCount": 25, "FindingsCount": 0 }, "CreatedTimeStamp": 1588111987.443, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE55555", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" }, { "LastUpdatedTimeStamp": 1588104489.981, "Name": "a1b2c3d4-5678-90ab-cdef-EXAMPLE66666", "ProviderType": "GitHub", "PullRequestId": "1", "MetricsSummary": { "MeteredLinesOfCodeCount": 25, "FindingsCount": 0 }, "CreatedTimeStamp": 1588104270.223, "State": "Completed", "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE66666", "Owner": "sample-owner", "RepositoryName": "sample-repository-name", "Type": "PullRequest" } ] }
11+
12+
For more information, see `ListCodeReviews<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListCodeReviews.html>`__ in the *Amazon DevOps Guru API Reference*

awscli/examples/codeguru-reviewer/list-recommendations.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**To list the recommendations for a completed code review**
2+
3+
The following ``list-recommendations`` example lists the recommendations for a comleted code review. This code review has one recommendations. ::
4+
5+
aws codeguru-reviewer list-recommendations \
6+
--code-review-arn arn:aws:codeguru-reviewer:us-west-2:544120495673:code-review:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
7+
8+
Output::
9+
10+
{ "RecommendationSummaries": [ { "Description": "\n\n**Problem** \n You are using a `ConcurrentHashMap`, but your usage of `containsKey()` and `get()` may not be thread-safe at lines: **63 and 64**. In between the check and the `get()` another thread can remove the key and the `get()` will return `null`. The remove that can remove the key is at line: **59**.\n\n**Fix** \n Consider calling `get()`, checking instead of your current check if the returned object is `null`, and then using that object only, without calling `get()` again.\n\n**More info** \n [View an example on GitHub](https://github.com/apache/hadoop/blob/f16cf877e565084c66bc63605659b157c4394dc8/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3Guard.java#L302-L304) (external link).", "RecommendationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "StartLine": 63, "EndLine": 64, "FilePath": "src/main/java/com/company/sample/application/CreateOrderThread.java" } ] }
11+
12+
For more information, see `ListRecommendations<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRecommendations.html>`__ in the *Amazon DevOps Guru API Reference*.

awscli/examples/codeguru-reviewer/list-repository-associations.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**To list the repository associations in your AWS account**
2+
3+
The following ``list-repository-associations`` example returns a list of repository association summary objects in your account. You can filter the returned list by ``ProviderType``, ``Name``, ``State``, and ``Owner``. ::
4+
5+
aws codeguru-reviewer list-repository-associations
6+
7+
Output::
8+
9+
{ "RepositoryAssociationSummaries": [ { "LastUpdatedTimeStamp": 1595886609.616, "Name": "test", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Owner": "sample-owner", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProviderType": "Bitbucket" }, { "LastUpdatedTimeStamp": 1595636969.035, "Name": "CodeDeploy-CodePipeline-ECS-Tutorial", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Owner": "123456789012", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "ProviderType": "CodeCommit" }, { "LastUpdatedTimeStamp": 1595634785.983, "Name": "My-ecs-beta-repo", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Owner": "123456789012", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "ProviderType": "CodeCommit" }, { "LastUpdatedTimeStamp": 1590712811.77, "Name": "MyTestCodeCommit", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE44444", "Owner": "123456789012", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE44444", "ProviderType": "CodeCommit" }, { "LastUpdatedTimeStamp": 1588102637.649, "Name": "aws-codeguru-profiler-sample-application", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE55555", "Owner": "sample-owner", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE55555", "ProviderType": "GitHub" }, { "LastUpdatedTimeStamp": 1588028233.995, "Name": "codeguru-profiler-demo-app", "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE66666", "Owner": "sample-owner", "State": "Associated", "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE66666", "ProviderType": "GitHub" } ] }
10+
11+
For more information, see `ListRepositoryAssociations<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html>`__ in the *Amazon DevOps Guru API Reference*.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
**To create a path**
2+
3+
The following ``create-network-insights-path`` example creates a path. The source is the specified internet gateway and the destination is the specified EC2 instance. To determine whether the destination is reachable using the specified protocol and port, analyze the path using the ``start-network-insights-analysis`` command. ::
4+
5+
aws ec2 create-network-insights-path \
6+
--source igw-0797cccdc9d73b0e5 \
7+
--destination i-0495d385ad28331c7 \
8+
--destination-port 22 \
9+
--protocol TCP
10+
11+
Output::
12+
13+
{
14+
"NetworkInsightsPaths": {
15+
"NetworkInsightsPathId": "nip-0b26f224f1d131fa8",
16+
"NetworkInsightsPathArn": "arn:aws:ec2:us-east-1:123456789012:network-insights-path/nip-0b26f224f1d131fa8",
17+
"CreatedDate": "2021-01-20T22:43:46.933Z",
18+
"Source": "igw-0797cccdc9d73b0e5",
19+
"Destination": "i-0495d385ad28331c7",
20+
"Protocol": "tcp"
21+
}
22+
}
23+
24+
For more information, see `Getting started using the AWS CLI <https://docs.aws.amazon.com/vpc/latest/reachability/getting-started-cli.html>`__ in the *Reachability Analyzer Guide*.

0 commit comments

Comments
 (0)