Skip to content

SaaS API Params

SaaS API parameters is a way for you to define the parameters that you want your customers to configure. Your SaaS may have any number of API parameters.

You can then configure your service or infrastructure configuration through these API parameters. To learn more about that, please see this page.

Each API Parameter can be configured with the following set of properties:

  • Key: key to uniquely identify this API parameter.
  • Name: display name that will be used for your customers to specify the value of this parameter.
  • Description: display description for you to describe this parameter to your customer.
  • Type: data type of the API parameter. It could be boolean, number, string, bytes, JSON. There is a special type Resource that's used to link different resource, see this for more details.
  • Required: specify if this field is a required parameter for your customers. Note that we will require your customers to input the value before they can submit any provisioning request.
  • Export: configures if this field will be returned as part of the describe call on this component.
  • Modifiable: configure if this field is modifiable once configured.
  • Default value: if this parameter is not required, we need a default value for this parameter in case your customer don't input any value to this parameter. Note that default value is a mandatory field if required parameter is configured as false.
  • Limits: define lower/upper bounds depending on the type of the parameter. For numbers, its min and max values. For string, its the length of the string.
  • Options: in-case you want your customers to choose between the pre-defined values, you can set this property with a list of possible values. This property is only applicable to numbers, string, JSON types. As an example, you can ask your customer to take Instance Type as an API param for your Private GPT SaaS with pre-defined list of GPU instance types.

Here is an example API param for PostgreSQL writer resource. As you can see different API parameter are defined and used to configure database configuration (ex - postgresqlUsername) and underlying infrastructure (ex - writerInstanceType):

x-omnistrate-api-params:
  - key: writerInstanceType
    description: Writer Instance Type
    name: Writer Instance Type
    type: String
    modifiable: true
    required: true
    export: true
  - key: postgresqlPassword
    description: Default DB Password
    name: Password
    type: String
    modifiable: false
    required: true
    export: false
  - key: postgresqlDatabase
    description: Default DB Name
    name: Default Database
    type: String
    modifiable: false
    required: true
    export: true
  - key: postgresqlUsername
    description: Username
    name: Default DB Username
    type: String
    modifiable: false
    required: true
    export: true
  - key: postgresqlRootPassword
    description: Root Password
    name: Root DB Password
    type: String
    modifiable: false
    required: false
    export: false
    defaultValue: rootpassword12345
environment:
  - POSTGRESQL_PASSWORD=$var.postgresqlPassword
  - POSTGRESQL_DATABASE=$var.postgresqlDatabase
  - POSTGRESQL_USERNAME=$var.postgresqlUsername
  - POSTGRESQL_POSTGRES_PASSWORD=$var.postgresqlRootPassword
  - POSTGRESQL_PGAUDIT_LOG=READ,WRITE
  - POSTGRESQL_LOG_HOSTNAME=true
  - POSTGRESQL_REPLICATION_MODE=master
  - POSTGRESQL_REPLICATION_USER=repl_user
  - POSTGRESQL_REPLICATION_PASSWORD=repl_password
  - POSTGRESQL_DATA_DIR=/var/lib/postgresql/data/dbdata
  - SECURITY_CONTEXT_USER_ID=1001
  - SECURITY_CONTEXT_FS_GROUP=1001
  - SECURITY_CONTEXT_GROUP_ID=0
x-omnistrate-compute:
  instanceTypes:
    - cloudProvider: aws
      apiParam: writerInstanceType
    - cloudProvider: gcp
      apiParam: writerInstanceType