4. Create a service
To create the AosEdge service you have been logged in as an SP user. User types are defined on AosEdge dictionary. If you have problems with the login, please refer to the Get Access page.
Create a service on AosCloud site:
- On AosCloud, go to Services and click the plus button in the top-right corner of the screen to start creating a service.
- Enter the service name under Title and a description under Description.
- Click Add to finish creating the service.
- After creating the service, click its title to enter the Service Detail screen, copy the value from the UUID field somewhere to reserve it for future use.
Create a new service version
-
Sign in to your GitHub account and fork the sample Aos SDK 'Hello World' (use the aos-signer branch) to your repository. See the GitHub tutorial Fork a Repo for detail.
-
Open Webhook.site in your web browser at https://webhook.site. Webhook.site generates a unique URL for processing requests, like in the figure below.
-
On your workstation, open the file meta/config.yaml in a text editor. This is the main configuration of the service. It should look as follows:
-
Insert AosCloud service UUID (copied at step 4 of “Create your first service in AosCloud” above) as service_uid in the publish section (line 19):
-
Open file webhook_example.py and put webhook unique URL into code:
Instead of:
Should be:
where HTTP_REQUEST_RECEIVER_URL points to the newly generated URL.
Sign and upload the service version.
You can use this scenario to upload your service directly to AosCloud using the aos-signer tool.
- Sign the service. In the directory of your cloned application, run the following command:
You will see the following output:
aos-signer sign
This creates an archive named service.tar.gz. This is a ready-for-upload service archive.Starting SERVICE SIGNING process...
Starting CONFIG VALIDATION process...
Validating config... VALID
Copying application... INFO: copying
...
Copying configuration... DONE
Copying default state... Not required by config
Creating archive... DONE
Sing package... DONE
Creating service package... DONE - Upload service.tar.gz to AosCloud with the command:
If uploading was successful, the command output is completed with the Uploaded message.
aos-signer upload
After that, you can see the information about the uploaded service on the service detail page in the Services section of AosCloud.