creating apis does not work via cli command
aio rt:api:create /base-1 /relative-1 get generic --response-type http
Even after waiting 5 mins, the URL results in a 404. The URL should be in the form https://adobeioruntime.net/apis/YOUR_NAMESPACE/base-1/relative-1
Deploying the same api via app.config.yaml works:
application:
actions: actions
web: web-src
runtimeManifest:
packages:
test-app:
license: Apache-2.0
actions:
generic:
function: actions/generic/index.js
web: 'yes'
runtime: nodejs:18
inputs:
LOG_LEVEL: debug
annotations:
require-adobe-auth: false
final: true
apis:
my-api-name:
base-1:
relative-1:
generic:
method: get
response: http
JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-3901
This is the activity log of the api being created via yaml (successful):
This is the activity log of the api being created via cli (incorrect):
Not sure if the api-name being the base-path name is significant, it may not be, but that's a clue.
The api-name issue above is a red-herring.
Found the issue with the command - it's two things:
- the action name must be fully qualified with the package, if not it will 404: e.g. my-package/my-action
- the command does not actually verify if the action exists, not sure if it should (it would have caught this issue)
The API can't be tested right away, we need to wait 5 mins, so the user can't verify if it works. Also there is no action check here on the server itself, so a non-existent action can be set as an API.