Skip to content

Redis Database Keys

Alejandro Martinez Ruiz edited this page Aug 31, 2021 · 5 revisions

Apisonator stores keys on the Redis database, forming the database model.

The keys, separated by its relation with the Apisonator entities are:

Provider

  • provider_keys_set
    • Type: Set
    • Description: Contains all the provider keys configured in Apisonator

Service

  • service/provider_key:#{provider_key}/id
    • Type: String
    • Description: Contains the default Service ID of the provider identified by #{provider_key}
  • service/provider_key:#{provider_key}/ids
    • Type: Set
    • Description: Contains all the Service IDs associated to the provider identified by #{provider_key}
  • services_set
    • Type: Set
    • Description: Contains all the Services IDs in Apisonator, independently of the providers
  • service_id:#{service_id}/applications
    • Type: Set
    • Description: Contains all the Applications belonging to the Service ID #{service_id}
  • service/id:#{service_id}/provider_key
    • Type: String
    • Description: Contains the Provider key that is associated to the Service ID #{service_id}
  • service/id:#{service_id}/user_registration_required
    • Type: String
    • Description: TODO
  • service/id:#{service_id}/referrer_filters_required
    • Type: String
    • Description: TODO
  • service/id:#{service_id}/backend_version
    • Type: String
    • Description: Tells the backend version associated to the Service ID #{service_id}. Used to decide which authentication method is used for the Service
  • service/id:#{service_id}/default_user_plan_id
    • Type: String
    • Description: Contains the default User plan identifier of the Service ID #{service_id}
  • service/id:#{service_id}/default_user_plan_name
    • Type: String
    • Description: Contains the default User plan name of the Service ID #{service_id}

Application

  • application/service_id:#{service_id}/key:#{user_key}/id
    • Type: String
    • Description: Contains the Application ID of the Application that belongs to the Service ID #{service_id} and has the user key #{user_key}. This key is NOT an application key(app_key)
  • application/service_id:#{service_id}/id:#{application_id}/keys"
    • Type: Set
    • Description: Contains the Application keys (app_key) of the Application #{application_id} that belongs to the Service #{service_id}. It does NOT contain user keys (user_key)
  • application/service_id:#{service_id}/id:#{application_id}/referrer_filters
    • Type: Set
    • Description: Contains the referrer filters of the Application #{application_id} that belongs to the Service #{service_id}. It does NOT contain user keys (user_key)
  • application/service_id:#{service_id}/id:#{application_id}/state
    • Type: String
    • Description: Contains the state of the Application #{application_id} that belongs to the Service #{service_id}
  • application/service_id:#{service_id}/id:#{application_id}/user_required
    • Type: String
    • Description: TODO
  • application/service_id:#{service_id}/id:#{application_id}/plan_name
    • Type: String
    • Description: Contains the Application plan name of the Application #{application_id} that belongs to the Service #{service_id}
  • application/service_id:#{service_id}/id:#{application_id}/plan_id
    • Type: String
    • Description: Contains the Application plan ID of the Application #{application_id} that belongs to the Service #{service_id}
  • application/service_id:#{service_id}/id:#{id}/redirect_url
    • Type: String
    • Description: TODO

Metric

  • metric/service_id:#{service_id}/name:#{metric_name}/id"
    • Type: String
    • Description: Contains the Metric ID corresponding to the Metric with name #{metric_name} belonging to the Service #{service_id}
  • metric/service_id:#{service_id}/id:#{metric_id}/name
    • Type: String
    • Description: Contains the Metric name corresponding to the Metric with ID #{metric_id} belonging to the Service #{service_id}
  • metric/service_id:#{service_id}/id:#{metric_id}/parent_id
    • Type: TODO
    • Description: Returns the Metric ID of the parent metric of the Metric with ID #{metric_id} belonging to the Service #{service_id}
  • metrics/service_id:#{service_id}/ids
    • Type: Set
    • Description: Contains all the Metric IDs of the Service #{service_id}

Usage Limit

  • usage_limit/service_id:#{service_id}/plan_id:#{plan_id}/metric_id:#{metric_id}/#{period}
    • Type: String
    • Description: Contains the Usage limit configured on the period #{period} in the Plan #{plan_id} for a Metric #{metric_id} that has been defined in the Service #{service_id}. #{period} can be one of: ‘minute’, ‘hour’, ‘day’, ‘week’, ‘month’, ‘eternity'

OAuth Tokens

  • oauth_access_tokens/service:#{service_id}/app:#{app_id}
    • Type: TODO
    • Description: TODO
  • oauth_access_tokens/service:#{service_id}/#{token}
    • Type: TODO
    • Description: TODO

Service Tokens

  • service_token/token:#{service_token}/service_id:#{service_id}
    • Type: Hash
    • Description: Contains the permissions associated to the Service #{service_id} when the Service Token #{service_token} is being used

Alerts

  • alerts/current_id
    • Type: String
    • Description: Contains the ID of the latest alert. This value is incremented every time an alert is processed
  • alerts/service_id:#{service_id}/app_id:#{app_id}/#{compacted_hour_start}/current_max
    • Type: String
    • Description: TODO
    • expires in 1 day
  • alerts/service_id:#{service_id}/app_id:#{app_id}/#{discrete_utilization}/already_notified
    • Type: String
    • Description: Set to "1" if the alert happens for the first time in a given #{discrete_utilization} value

Alert Limits

  • alerts/service_id:#{service_id}/allowed_set
    • Type: Set
    • Description: Contains all the limit values that have been configured on the Service #{service_id}

Service Errors

  • errors/service_id:#{service_id}
    • Type: List
    • Description: Contains the errors of the Service #{service_id}

Events

  • events/queue
    • Type: Sorted Set
    • Description: TODO
  • events/ping
    • Type: String
    • Description: TODO
  • events/id
    • Type: String
    • Description: Counter that is incremented each time an event is stored

Notifications

  • notify/aggregator/batch
    • Type: List
    • Description: Contains the Notifications. TODO add more information

Transactions

  • transactions/service_id:#{service_id}
    • Type: List
    • Description: Contains the Transactions. TODO add more information

Stats

  • stats/service:{#{service_id}}/cinstance:#{app_id}/metric:#{metric_id}/#{period_granularity}:#{start_of_the_period_granularity_compacted}
    • Type: String
    • Description: TODO