curl -o- https://raw.githubusercontent.com/redhat-developer/app-services-cli/main/scripts/install.sh | bash
#make sure your $HOME/bin is included in your $PATH
#open a new terminal
rhoas --version
#add cli completion for zsh
rhoas completion zsh > "${fpath[1]}/_rhoas"
rhoas login
rhoas whoami
rhoas status
rhoas service-registry create --name globex
curl -O https://raw.githubusercontent.com/cloud-services-summit-connect-2022/product-catalog-api/main/openapi/openapi-spec.yml
rhoas service-registry artifact create --file ./openapi-spec.yml --type OPENAPI
## store your 3scale access token and your tenant admin url
export THREESCALE_ACCESS_TOKEN=<ACCESS_TOKEN> export THREESCALE_TENANT_ADMIN_PORTAL_URL=3scale-admin.apps.your-domain
## create a container for 3scale-toolbox adding your tenant admin url
docker run --name=3scale-toolbox-original
quay.io/redhat/3scale-toolbox 3scale remote
add 3scale-tenant -k https://$THREESCALE_ACCESS_TOKEN@$THREESCALE_TENANT_ADMIN_PORTAL_URL
## create a new image with your 3scale tenant info
docker commit 3scale-toolbox-original 3scale-toolbox
## create an alias for the containerized toolbox
alias 3scale='docker run 3scale-toolbox 3scale -k'
## create your API management resources on 3scale
#API product 3scale service create 3scale-tenant globex-product-catalog --description='Product Catalog API for the Globex online app'
## API Backend
```curl -v -X POST "$THREESCALE_TENANT_ADMIN_PORTAL_URL/admin/api/backend_apis.json" \
-d 'access_token=$THREESCALE_ACCESS_TOKEN&name=globex-catalog-backend&description=Backend+for+the+Product+Catalog+service&private_endpoint=https%3A%2F%2Fcatalog-globex-user1.apps.cluster-gnfvj.sandbox565.opentlc.com'
{
"backend_api": {
"id": 451,
"name": "globex-catalog-backend2",
"system_name": "globex_catalog_backend",
"description": "Backend for the Product Catalog service",
"private_endpoint": "https://catalog-globex-user1.apps.cluster-gnfvj.sandbox565.opentlc.com:443",
"account_id": 575,
"created_at": "2022-11-11T17:25:59Z",
"updated_at": "2022-11-11T17:25:59Z",
"links": [
{
"rel": "metrics",
"href": "/admin/api/backend_apis/451/metrics"
},
{
"rel": "mapping_rules",
"href": "/admin/api/backend_apis/451/mapping_rules"
}
]
}
}
curl -v -X POST "$THREESCALE_TENANT_ADMIN_PORTAL_URL/admin/api/services/481/backend_usages.json" -d 'access_token=$THREESCALE_ACCESS_TOKEN&backend_api_id=451&path=%2F'
{
"backend_usage": {
"id": 462,
"path": "/",
"service_id": 481,
"backend_id": 451,
"links": [
{
"rel": "service",
"href": "$THREESCALE_TENANT_ADMIN_PORTAL_URL/admin/api/services/481"
},
{
"rel": "backend_api",
"href": "$THREESCALE_TENANT_ADMIN_PORTAL_URL/admin/api/backend_apis/451"
}
]
}
}
3scale application-plan create --publish 3scale-tenant globex_product_catalog globex-product-catalog-app-plan
3scale account find 3scale-tenant john
id => 576
org_name => Developer
3scale application create 3scale-tenant 576 globex_product_catalog globex_product_catalog_app_plan globex-product-catalog-app
3scale service show 3scale-tenant globex_product_catalog2 -o json | jq .id
curl -v -X POST "$THREESCALE_TENANT_ADMIN_PORTAL_URL/admin/api/services/481/proxy/deploy.json" -d 'access_token=$THREESCALE_ACCESS_TOKEN'
curl -s -X GET "$THREESCALE_TENANT_ADMIN_PORTAL_URL/admin/api/applications/find.json?access_token=$THREESCALE_ACCESS_TOKEN&application_id=2083" | jq .application.user_key