Sensedia CLI Declarative Mode

Overview

With Sensedia CLI Declarative Mode, you can manage resources using .yaml files instead of typing commands followed by flags or answering the interactive questions. Our Declarative Mode focuses more on what you want to achieve than on how. It also means that you can describe the resources you wish to add, update or delete in a single file, which might lead to a faster result. Of course, if you prefer going step by step, just go back to the previous pages. There, we describe how to manage API Platform and Adaptive Governance resources through questions, with the interactive mode, or via flags.

Necessary Commands

Basically, only two commands will be used to support the Declarative Mode:

# When creating new resources or updating existing ones
$ ssd apply -f file.yaml <options>

# When deleting the resources that were created before
ssd delete -f file.yaml <options>

Usage (How to Structure the Objects)

apiVersion: api-name/api-version
kind: resource type (e.g.: environment, API, plan etc.)

# The metadata structure will be a set of key and value fields, which will only be used for file documentation purposes.
# This information is not saved or linked to any resource on Sensedia API Platform.
metadata:
  # Open text description related to each resource;
  # The "spec" field can vary according to the object you want to create;
  # Please refer to the json schemas to find the required information and other rules regarding each "Kind".

spec:
  # Identifying fields
    # See each product section for specific requirements
  # Other fields
    # See each product section for specific requirements

Processing Documents

  • First of all, Sensedia CLI will check if the file type is .yaml and whether it contains at least one document. Then, using the ssd apply command, the file will be processed according to its own declared order.

  • When the ssd delete command is used, the documents will be processed in the opposite order to the one declared in the file.

CLI will report back in case there are errors while processing the files. However, it will continue processing the input file and performing the other operations. When the flags --fail-fast or -e are informed, CLI will stop running at the first document with an error. The --validate-file flag can be used to validate the file structure for verification purposes only, but without applying any changes to the platform.

When the execution is finished, Sensedia CLI should show a list with the modified resources:

Summary:

# Created Resources: X
# Updated Resources: Y
# Deleted Resources: Z
Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]