Skip to main content

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:

  1. On AosCloud, go to Services and click the plus button in the top-right corner of the screen to start creating a service. Services
  2. Enter the service name under Title and a description under Description. Services
  3. Click Add to finish creating the service.
  4. 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. Services

Create a new service version

  1. 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.
    Hello world repo

  2. 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.
    Webhook site with uuids

  3. 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:
    Webhook site with uuids

  4. 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):
    Webhook site with uuids

  5. Open file webhook_example.py and put webhook unique URL into code:

    Instead of:
    Webhook site with uuids

    Should be:
    Webhook site with uuids
    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.

  1. Sign the service. In the directory of your cloned application, run the following command:
    aos-signer sign
    You will see the following output:
     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
    This creates an archive named service.tar.gz. This is a ready-for-upload service archive.
  2. Upload service.tar.gz to AosCloud with the command:
    aos-signer upload
    If uploading was successful, the command output is completed with the Uploaded message.
    After that, you can see the information about the uploaded service on the service detail page in the Services section of AosCloud.