Skip to content

Commit

Permalink
doc: update resource create examples (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
raulb authored Aug 26, 2022
1 parent 81a62ef commit 9023539
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 18 deletions.
32 changes: 27 additions & 5 deletions cmd/meroxa/root/resources/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,33 @@ func (c *Create) Docs() builder.Docs {

// TODO: Provide example with `--env` once it's not behind a feature flag
Example: `
meroxa resources create store --type postgres -u $DATABASE_URL --metadata '{"logical_replication":"true"}'
meroxa resources create datalake --type s3 -u "s3://$AWS_ACCESS_KEY_ID:$AWS_ACCESS_KEY_SECRET@us-east-1/meroxa-demos"
meroxa resources create warehouse --type redshift -u $REDSHIFT_URL
meroxa resources create slack --type url -u $WEBHOOK_URL
`,
$ meroxa resources create store --type postgres -u "$DATABASE_URL" --metadata '{"logical_replication":"true"}'
$ meroxa resources create datalake --type s3 -u "s3://$AWS_ACCESS_KEY_ID:$AWS_ACCESS_KEY_SECRET@us-east-1/meroxa-demos"
$ meroxa resources create warehouse --type redshift -u "$REDSHIFT_URL"
$ meroxa resources create slack --type url -u "$WEBHOOK_URL"
$ meroxa resource create mysqldb \
--type mysql \
--url "mysql://$MYSQL_USER:$MYSQL_PASS@$MYSQL_URL:$MYSQL_PORT/$MYSQL_DB"
$ meroxa resource create mongo \
--type mongodb \
-u "mongodb://$MONGO_USER:$MONGO_PASS@$MONGO_URL:$MONGO_PORT"
$ meroxa resource create elasticsearch \
--type elasticsearch \
-u "https://$ES_USER:$ES_PASS@$ES_URL:$ES_PORT" \
--metadata '{"index.prefix": "$ES_INDEX","incrementing.field.name": "$ES_INCREMENTING_FIELD"}'
$ meroxa resource create mybigquery \
--type bigquery \
-u "bigquery://$GCP_PROJECT_ID/$GCP_DATASET_NAME" \
--client-key "$(cat $GCP_SERVICE_ACCOUNT_JSON_FILE)"
$ meroxa resource create snowflake \
--type snowflakedb \
-u "snowflake://$SNOWFLAKE_URL/meroxa_db/stream_data" \
--username meroxa_user \
--password $SNOWFLAKE_PRIVATE_KEY`,
}
}

Expand Down
30 changes: 26 additions & 4 deletions docs/cmd/md/meroxa_resources_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,33 @@ meroxa resources create [NAME] --type TYPE --url URL [flags]

```
meroxa resources create store --type postgres -u $DATABASE_URL --metadata '{"logical_replication":"true"}'
meroxa resources create datalake --type s3 -u "s3://$AWS_ACCESS_KEY_ID:$AWS_ACCESS_KEY_SECRET@us-east-1/meroxa-demos"
meroxa resources create warehouse --type redshift -u $REDSHIFT_URL
meroxa resources create slack --type url -u $WEBHOOK_URL
$ meroxa resources create store --type postgres -u "$DATABASE_URL" --metadata '{"logical_replication":"true"}'
$ meroxa resources create datalake --type s3 -u "s3://$AWS_ACCESS_KEY_ID:$AWS_ACCESS_KEY_SECRET@us-east-1/meroxa-demos"
$ meroxa resources create warehouse --type redshift -u "$REDSHIFT_URL"
$ meroxa resources create slack --type url -u "$WEBHOOK_URL"
$ meroxa resource create mysqldb \
--type mysql \
--url "mysql://$MYSQL_USER:$MYSQL_PASS@$MYSQL_URL:$MYSQL_PORT/$MYSQL_DB"
$ meroxa resource create mongo \
--type mongodb \
-u "mongodb://$MONGO_USER:$MONGO_PASS@$MONGO_URL:$MONGO_PORT"
$ meroxa resource create elasticsearch \
--type elasticsearch \
-u "https://$ES_USER:$ES_PASS@$ES_URL:$ES_PORT" \
--metadata '{"index.prefix": "$ES_INDEX","incrementing.field.name": "$ES_INCREMENTING_FIELD"}'
$ meroxa resource create mybigquery \
--type bigquery \
-u "bigquery://$GCP_PROJECT_ID/$GCP_DATASET_NAME" \
--client-key "$(cat $GCP_SERVICE_ACCOUNT_JSON_FILE)"
$ meroxa resource create snowflake \
--type snowflakedb \
-u "snowflake://$SNOWFLAKE_URL/meroxa_db/stream_data" \
--username meroxa_user \
--password $SNOWFLAKE_PRIVATE_KEY
```

### Options
Expand Down
30 changes: 26 additions & 4 deletions docs/cmd/www/meroxa-resources-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,33 @@ meroxa resources create [NAME] --type TYPE --url URL [flags]

```
meroxa resources create store --type postgres -u $DATABASE_URL --metadata '{"logical_replication":"true"}'
meroxa resources create datalake --type s3 -u "s3://$AWS_ACCESS_KEY_ID:$AWS_ACCESS_KEY_SECRET@us-east-1/meroxa-demos"
meroxa resources create warehouse --type redshift -u $REDSHIFT_URL
meroxa resources create slack --type url -u $WEBHOOK_URL
$ meroxa resources create store --type postgres -u "$DATABASE_URL" --metadata '{"logical_replication":"true"}'
$ meroxa resources create datalake --type s3 -u "s3://$AWS_ACCESS_KEY_ID:$AWS_ACCESS_KEY_SECRET@us-east-1/meroxa-demos"
$ meroxa resources create warehouse --type redshift -u "$REDSHIFT_URL"
$ meroxa resources create slack --type url -u "$WEBHOOK_URL"
$ meroxa resource create mysqldb \
--type mysql \
--url "mysql://$MYSQL_USER:$MYSQL_PASS@$MYSQL_URL:$MYSQL_PORT/$MYSQL_DB"
$ meroxa resource create mongo \
--type mongodb \
-u "mongodb://$MONGO_USER:$MONGO_PASS@$MONGO_URL:$MONGO_PORT"
$ meroxa resource create elasticsearch \
--type elasticsearch \
-u "https://$ES_USER:$ES_PASS@$ES_URL:$ES_PORT" \
--metadata '{"index.prefix": "$ES_INDEX","incrementing.field.name": "$ES_INCREMENTING_FIELD"}'
$ meroxa resource create mybigquery \
--type bigquery \
-u "bigquery://$GCP_PROJECT_ID/$GCP_DATASET_NAME" \
--client-key "$(cat $GCP_SERVICE_ACCOUNT_JSON_FILE)"
$ meroxa resource create snowflake \
--type snowflakedb \
-u "snowflake://$SNOWFLAKE_URL/meroxa_db/stream_data" \
--username meroxa_user \
--password $SNOWFLAKE_PRIVATE_KEY
```

### Options
Expand Down
32 changes: 27 additions & 5 deletions etc/man/man1/meroxa-resources-create.1
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,33 @@ Use the create command to add resources to your Meroxa resource catalog.

.nf

meroxa resources create store --type postgres -u $DATABASE_URL --metadata '{"logical_replication":"true"}'
meroxa resources create datalake --type s3 -u "s3://$AWS_ACCESS_KEY_ID:$AWS_ACCESS_KEY_SECRET@us-east-1/meroxa-demos"
meroxa resources create warehouse --type redshift -u $REDSHIFT_URL
meroxa resources create slack --type url -u $WEBHOOK_URL

$ meroxa resources create store --type postgres -u "$DATABASE_URL" --metadata '{"logical_replication":"true"}'
$ meroxa resources create datalake --type s3 -u "s3://$AWS_ACCESS_KEY_ID:$AWS_ACCESS_KEY_SECRET@us-east-1/meroxa-demos"
$ meroxa resources create warehouse --type redshift -u "$REDSHIFT_URL"
$ meroxa resources create slack --type url -u "$WEBHOOK_URL"
$ meroxa resource create mysqldb \\
--type mysql \\
--url "mysql://$MYSQL_USER:$MYSQL_PASS@$MYSQL_URL:$MYSQL_PORT/$MYSQL_DB"

$ meroxa resource create mongo \\
--type mongodb \\
-u "mongodb://$MONGO_USER:$MONGO_PASS@$MONGO_URL:$MONGO_PORT"

$ meroxa resource create elasticsearch \\
--type elasticsearch \\
-u "https://$ES_USER:$ES_PASS@$ES_URL:$ES_PORT" \\
--metadata '{"index.prefix": "$ES_INDEX","incrementing.field.name": "$ES_INCREMENTING_FIELD"}'

$ meroxa resource create mybigquery \\
--type bigquery \\
-u "bigquery://$GCP_PROJECT_ID/$GCP_DATASET_NAME" \\
--client-key "$(cat $GCP_SERVICE_ACCOUNT_JSON_FILE)"

$ meroxa resource create snowflake \\
--type snowflakedb \\
-u "snowflake://$SNOWFLAKE_URL/meroxa_db/stream_data" \\
--username meroxa_user \\
--password $SNOWFLAKE_PRIVATE_KEY

.fi
.RE
Expand Down

0 comments on commit 9023539

Please sign in to comment.