apiVersion: runtimeconditions.io/v1alpha1
kind: RuntimeConditionsExtensionDefinition
metadata:
  id: https://runtimeconditions.io/extensions/rc/cql/0.1.0/runtimeconditions.extension.yaml
  version: 0.1.0
  description: Declares access to one existing keyspace through Cassandra Query Language (CQL).
spec:
  kinds:
    - name: rc.cql
      description: A workload can connect to a CQL datastore and use a keyspace the platform makes available.
  interfaceTypes:
    - name: keyspace
      targetKind: rc.cql
      description: Access to one existing keyspace on a CQL-compatible datastore.
  interfaceFields:
    - name: keyspace
      targetKind: rc.cql
      targetType: keyspace
      description: Exact keyspace name when the workload requires one. Omit it to let the platform choose.
  schemas:
    - id: rc-cql-keyspace
      appliesToKind: rc.cql
      appliesToInterfaceType: keyspace
      description: Validates a logical datastore reference and its optional exact keyspace name.
      schema:
        $schema: https://json-schema.org/draft/2020-12/schema
        type: object
        required: [name, kind, interface]
        properties:
          name:
            type: string
            pattern: '\S'
            description: Logical name the platform uses to resolve the datastore and keyspace.
          kind:
            const: rc.cql
            description: Selects Cassandra Query Language for datastore access.
          interface:
            type: object
            description: Describes access to a single existing CQL keyspace.
            required: [type]
            properties:
              type:
                const: keyspace
                description: Targets one keyspace on a CQL datastore.
              keyspace:
                type: string
                pattern: '\S'
                description: Exact keyspace name with its original case, without CQL quoting syntax.
            additionalProperties: false
