-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding schemas-cli-examples #8985
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@onkabes
Thank you for your submission! There were a few issues that affected all of your examples, such as fixing your indententation. Please fix these formatting issues and push your updates.
a867cff
to
574facb
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8985 +/- ##
==========================================
- Coverage 0.08% 0.08% -0.01%
==========================================
Files 210 210
Lines 16952 16978 +26
==========================================
Hits 14 14
- Misses 16938 16964 +26 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM sending for maintainer review.
Output:: | ||
|
||
{ | ||
"Content": "{\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"version\": \"1.0.0\",\n \"title\": \"Event\"\n },\n \"paths\": {},\n \"components\": {\n \"schemas\": {\n \"Event\": {\n \"type\": \"object\",\n \"properties\": {\n \"ordinal\": {\n \"type\": \"number\",\n \"format\": \"int64\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"price\": {\n \"type\": \"number\",\n \"format\": \"double\"\n },\n \"address\": {\n \"type\": \"string\"\n },\n \"comments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n }\n }\n }\n }\n}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the \n
expected to be part of the output? Just checking that they weren't the result of copy+paste or something similar.
Running it for an AWS schema, I see the JSON on one line without the newlines.
aws schemas describe-schema --registry-name aws.events --schema-name aws.a4b@RoomStateChange
{
"Content": "{ \"openapi\": \"3.0.0\", \"info\": { \"version\": \"1.0.0\", \"title\": \"RoomStateChange\" }, \"paths\": {}, \"components\": { \"schemas\": { \"AWSEvent\": { \"type\": \"object\", \"required\": [ \"detail-type\", \"resources\", \"detail\", \"id\", \"source\", \"time\", \"region\", \"account\" ], \"x-amazon-events-detail-type\": \"Room State Change\", \"x-amazon-events-source\": \"aws.a4b\", \"properties\": { \"detail\": { \"$ref\": \"#/components/schemas/RoomStateChange\" }, \"account\": { \"type\": \"string\" }, \"detail-type\": { \"type\": \"string\" }, \"id\": { \"type\": \"string\" }, \"region\": { \"type\": \"string\" }, \"resources\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }, \"source\": { \"type\": \"string\" }, \"time\": { \"type\": \"string\", \"format\": \"date-time\" } } }, \"RoomStateChange\": { \"type\": \"object\", \"required\": [ \"mode\", \"calendar-event\", \"event-type\", \"version\" ], \"properties\": { \"calendar-event\": { \"$ref\": \"#/components/schemas/Calendar-event\" }, \"event-type\": { \"type\": \"string\" }, \"mode\": { \"type\": \"string\" }, \"version\": { \"type\": \"string\" } } }, \"Calendar-event\": { \"type\": \"object\", \"required\": [ \"profileArn\", \"calendarId\", \"provider\", \"startTime\", \"endTime\", \"id\", \"roomArn\" ], \"properties\": { \"calendarId\": { \"type\": \"string\" }, \"checkInTime\": { \"type\": \"string\", \"format\": \"date-time\" }, \"endTime\": { \"type\": \"string\", \"format\": \"date-time\" }, \"id\": { \"type\": \"string\" }, \"profileArn\": { \"type\": \"string\" }, \"provider\": { \"type\": \"string\" }, \"releaseTime\": { \"type\": \"string\", \"format\": \"date-time\" }, \"roomArn\": { \"type\": \"string\" }, \"startTime\": { \"type\": \"string\", \"format\": \"date-time\" } } } } } }",
"Description": "Schema for event type RoomStateChange, published by AWS service aws.a4b",
"LastModified": "2020-10-22T16:03:09+00:00",
"SchemaArn": "",
"SchemaName": "aws.a4b@RoomStateChange",
"SchemaVersion": "1",
"Tags": {},
"Type": "OpenApi3",
"VersionCreatedDate": "2020-10-22T16:03:09+00:00"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's important to still have the \"
escaping in the Content
value, if that's what the service is returning.
Output:: | ||
|
||
{ | ||
"Policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [{\n \"Sid\": \"AllowReadWrite\",\n \"Effect\": \"Allow\",\n \"Principal\": {\n \"AWS\": \"*\"\n },\n \"Action\": \"schemas:*\",\n \"Resource\": [\"arn:aws:schemas:us-east-1:012345678912:registry/example-registry\", \"arn:aws:schemas:us-east-1:012345678912:schema/example-registry*\"]\n }]\n}\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question as https://github.com/aws/aws-cli/pull/8985/files#r1923940695
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as #8985 (comment)
The following ``update-discoverer`` example updates an existing discoverer on the Event Bus. You can change the description, or you can enable or disable discovering schemas on cross-012345678912 Events. :: | ||
|
||
aws schemas update-discoverer \ | ||
--discoverer-id example-discoverer-id \ | ||
--no-cross-012345678912 | ||
|
||
Output:: | ||
|
||
{ | ||
"DiscovererArn": "arn:aws:schemas:us-east-1:012345678912:discoverer/example-discoverer-id", | ||
"DiscovererId": "example-discoverer-id", | ||
"SourceArn": "arn:aws:events:us-east-1:012345678912:event-bus/example-event-bus", | ||
"State": "STOPPED", | ||
"Cross012345678912": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like "account" may have been replaced with 012345678912
in three places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing cross-012345678912
and Cross012345678912
instead of cross-account
and CrossAccount
.
The following ``update-registry`` example waits for a new code binding to be created from the put-code-binding API. :: | ||
|
||
aws schemas wait code-binding-exists \ | ||
--registry-name example-registry \ | ||
--schema-name example-schema \ | ||
--schema-version 6 \ | ||
--language Python36 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a mismatch between the command in the code block and that in the description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, left a few comments.
6d0fedc
to
15d278f
Compare
requested changes have been made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replied to a few comments that don't appear resolved yet. It looks like some changes may not have been pushed up? Thanks.
Issue #, if available:
Description of changes:
Adding example CLI commands for Amazon EventBridge Schemas: https://docs.aws.amazon.com/cli/latest/reference/schemas/
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.