# Generated with protoc-gen-flipt-openapi openapi: 3.0.3 info: title: EnvironmentsService API description: Flipt Management REST API version: 2.9.0 paths: /api/v2/environments: get: tags: - EnvironmentsService description: List environments. operationId: listEnvironments responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ListEnvironmentsResponse' /api/v2/environments/{environmentKey}/branches: get: tags: - EnvironmentsService description: List all branch environments for a given environment. operationId: listEnvironmentBranches parameters: - name: environmentKey in: path description: the environment identifier, e.g. 'production/branch'. required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ListEnvironmentBranchesResponse' post: tags: - EnvironmentsService description: Create a branch environment. operationId: createBranchEnvironment parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production/branch'. required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/BranchEnvironmentRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/Environment' /api/v2/environments/{environmentKey}/branches/{key}: post: tags: - EnvironmentsService description: Propose changes from a branch environment. operationId: proposeEnvironment parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string - name: key in: path description: The branch key. required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/ProposeEnvironmentRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/EnvironmentProposalDetails' delete: tags: - EnvironmentsService description: Delete a branch environment. operationId: deleteBranchEnvironment parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production/branch'. required: true schema: type: string - name: key in: path description: The branch key. required: true schema: type: string responses: "200": description: OK content: {} /api/v2/environments/{environmentKey}/branches/{key}/changes: get: tags: - EnvironmentsService description: List changes for a branch environment. operationId: listBranchedEnvironmentChanges parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string - name: key in: path description: The branch environment key. required: true schema: type: string - name: from in: query description: The revision to list changes from (exclusive). If not provided, lists from the beginning. schema: type: string - name: limit in: query description: The maximum number of changes to return. Defaults to 10. schema: type: integer format: int32 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ListBranchedEnvironmentChangesResponse' /api/v2/environments/{environmentKey}/namespaces: get: tags: - EnvironmentsService description: List all namespaces within a given environment. operationId: listNamespaces parameters: - name: environmentKey in: path description: the environment identifier, e.g. 'production'. required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ListNamespacesResponse' put: tags: - EnvironmentsService description: Update an existing namespace. operationId: updateNamespace parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateNamespaceRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/NamespaceResponse' post: tags: - EnvironmentsService description: Create a new namespace. operationId: createNamespace parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateNamespaceRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/NamespaceResponse' /api/v2/environments/{environmentKey}/namespaces/{key}: get: tags: - EnvironmentsService description: Get a specific namespace. operationId: getNamespace parameters: - name: environmentKey in: path description: environment_key is the environment identifier, e.g. 'production'. required: true schema: type: string - name: key in: path description: key is the namespace key. required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/NamespaceResponse' delete: tags: - EnvironmentsService description: Delete a namespace. operationId: deleteNamespace parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string - name: key in: path description: The namespace key. required: true schema: type: string - name: revision in: query description: The resource revision for optimistic concurrency. schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/DeleteNamespaceResponse' /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources: put: tags: - EnvironmentsService description: Update an existing resource within a given namespace. operationId: updateResource parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string - name: namespaceKey in: path description: The namespace key for which to list resources, e.g. 'default'. required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateResourceRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ResourceResponse' post: tags: - EnvironmentsService description: Create a new resource within a given namespace. operationId: createResource parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string - name: namespaceKey in: path description: The namespace key for which to list resources, e.g. 'default'. required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateResourceRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ResourceResponse' /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}: get: tags: - EnvironmentsService description: List all resources within a given namespace. operationId: listResources parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string - name: namespaceKey in: path description: The namespace key for which to list resources, e.g. 'default'. required: true schema: type: string - name: typeUrl in: path description: The resource type - flipt.core.Flag or flipt.core.Segment. required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ListResourcesResponse' /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}/{key}: get: tags: - EnvironmentsService description: Get a specific resource within a given namespace. operationId: getResource parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string - name: namespaceKey in: path description: The namespace key for which to list resources, e.g. 'default'. required: true schema: type: string - name: typeUrl in: path description: The resource type - flipt.core.Flag or flipt.core.Segment. required: true schema: type: string - name: key in: path description: The resource key. required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ResourceResponse' delete: tags: - EnvironmentsService description: Delete a resource within a given namespace. operationId: deleteResource parameters: - name: environmentKey in: path description: The environment identifier, e.g. 'production'. required: true schema: type: string - name: namespaceKey in: path description: The namespace key for which to list resources, e.g. 'default'. required: true schema: type: string - name: typeUrl in: path description: The resource type - flipt.core.Flag or flipt.core.Segment. required: true schema: type: string - name: key in: path description: The key of the resource to delete. required: true schema: type: string - name: revision in: query schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/DeleteResourceResponse' components: schemas: BranchEnvironment: type: object properties: environmentKey: type: string description: The environment identifier, e.g. 'production/branch'. key: type: string description: The branch key. ref: type: string description: The git reference (branch or tag) for the branch environment. proposal: allOf: - $ref: '#/components/schemas/EnvironmentProposalDetails' description: The proposal details if a proposal has been made from this branch. description: The BranchEnvironment represents a branch environment. BranchEnvironmentRequest: type: object properties: environmentKey: type: string description: The environment identifier, e.g. 'production/branch'. key: type: string description: The branch key. description: The request message for creating a branch environment. Change: type: object properties: revision: type: string description: The revision identifier (e.g. commit SHA). message: type: string description: The commit message. authorName: type: string description: The author name. authorEmail: type: string description: The author email. timestamp: type: string description: The commit timestamp in RFC3339 format. scmUrl: type: string description: The URL of the commit in the source control management system. description: The change represents a single commit in the source control management system. Constraint: type: object properties: type: enum: - UNKNOWN_COMPARISON_TYPE - STRING_COMPARISON_TYPE - NUMBER_COMPARISON_TYPE - BOOLEAN_COMPARISON_TYPE - DATETIME_COMPARISON_TYPE - ENTITY_ID_COMPARISON_TYPE type: string format: enum property: type: string operator: type: string value: type: string description: type: string DeleteNamespaceResponse: type: object properties: revision: type: string description: The resource revision for optimistic concurrency. description: The response message for deleting a namespace. DeleteResourceResponse: type: object properties: revision: type: string description: The resource revision for optimistic concurrency. description: The response message for deleting a resource. Distribution: type: object properties: variant: type: string rollout: type: number format: float Environment: type: object properties: key: type: string description: The environment key. name: type: string description: The environment name. default: type: boolean description: The default indicates if this is the default environment. configuration: allOf: - $ref: '#/components/schemas/EnvironmentConfiguration' description: The environment configuration. description: The Environment represents a environment. EnvironmentConfiguration: type: object properties: ref: type: string description: The git reference (branch or tag) for the environment. directory: type: string description: The directory within the repository where environment resources are located. remote: type: string description: The git remote URL for the environment. base: type: string description: The base branch or tag for the environment. scm: enum: - SCM_UNKNOWN - SCM_GITHUB - SCM_GITEA - SCM_GITLAB - SCM_AZURE - SCM_BITBUCKET type: string description: The source control management system for the environment. format: enum description: The EnvironmentConfiguration represents the configuration for an environment. EnvironmentProposalDetails: type: object properties: url: type: string description: The URL of the proposal in the source control management system. state: enum: - PROPOSAL_STATE_UNKNOWN - PROPOSAL_STATE_OPEN - PROPOSAL_STATE_MERGED - PROPOSAL_STATE_CLOSED type: string description: The state of the proposal. format: enum description: The details of a proposal. Flag: type: object properties: key: type: string type: enum: - VARIANT_FLAG_TYPE - BOOLEAN_FLAG_TYPE type: string format: enum name: type: string description: type: string enabled: type: boolean variants: type: array items: $ref: '#/components/schemas/Variant' rules: type: array items: $ref: '#/components/schemas/Rule' rollouts: type: array items: $ref: '#/components/schemas/Rollout' defaultVariant: type: string metadata: type: object GoogleProtobufAny: type: object properties: '@type': type: string description: The type of the serialized message. additionalProperties: true description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. GoogleProtobufValue: description: Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. ListBranchedEnvironmentChangesResponse: type: object properties: changes: type: array items: $ref: '#/components/schemas/Change' description: The list of changes. description: The response message for listing changes in a branched environment. ListEnvironmentBranchesResponse: type: object properties: branches: type: array items: $ref: '#/components/schemas/BranchEnvironment' description: The list of branch environments. description: The response message for listing branch environments for a given environment. ListEnvironmentsResponse: type: object properties: environments: type: array items: $ref: '#/components/schemas/Environment' description: The list of environments. description: The response message for listing environments. ListNamespacesResponse: type: object properties: items: type: array items: $ref: '#/components/schemas/Namespace' description: The list of namespaces. revision: type: string description: The resource revision for optimistic concurrency. description: The response message for listing namespaces. ListResourcesResponse: type: object properties: resources: type: array items: $ref: '#/components/schemas/Resource' description: The list of resources. revision: type: string description: The resource revision for optimistic concurrency. description: The response message for listing resources. Namespace: type: object properties: key: type: string description: The namespace key. name: type: string description: The namespace name. description: type: string description: The namespace description. protected: type: boolean description: The namespace protection status. description: Namespace represents a grouping of related flags and segments. NamespaceResponse: type: object properties: namespace: allOf: - $ref: '#/components/schemas/Namespace' description: The list of namespaces. revision: type: string description: The resource revision for optimistic concurrency. description: The response message for getting a namespace. ProposeEnvironmentRequest: type: object properties: environmentKey: type: string description: The environment identifier, e.g. 'production'. key: type: string description: The branch key. title: type: string description: The title of the proposal. body: type: string description: The body of the proposal. draft: type: boolean description: The draft status of the proposal. description: The request message for proposing changes from a branch environment. Resource: type: object properties: namespaceKey: type: string description: The namespace key for which to list resources, e.g. 'default'. key: type: string description: The resource key. payload: allOf: - $ref: '#/components/schemas/ResourcePayload' description: |- The arbitrary typed resource payload (e.g. flipt.core.Flag, flipt.core.Segment). {"@type": "flipt.core.Flag", "key": "my_flag"} description: The resource message representing an arbitrary typed resource payload. ResourceResponse: type: object properties: resource: allOf: - $ref: '#/components/schemas/Resource' description: The resource. revision: type: string description: The resource revision for optimistic concurrency. description: The response message for getting a resource. Rollout: type: object properties: type: enum: - UNKNOWN_ROLLOUT_TYPE - SEGMENT_ROLLOUT_TYPE - THRESHOLD_ROLLOUT_TYPE type: string format: enum description: type: string segment: $ref: '#/components/schemas/RolloutSegment' threshold: $ref: '#/components/schemas/RolloutThreshold' RolloutSegment: type: object properties: value: type: boolean segments: type: array items: type: string segmentOperator: enum: - OR_SEGMENT_OPERATOR - AND_SEGMENT_OPERATOR type: string format: enum RolloutThreshold: type: object properties: percentage: type: number format: float value: type: boolean Rule: type: object properties: segmentOperator: enum: - OR_SEGMENT_OPERATOR - AND_SEGMENT_OPERATOR type: string format: enum segments: type: array items: type: string distributions: type: array items: $ref: '#/components/schemas/Distribution' Segment: type: object properties: key: type: string matchType: enum: - ALL_MATCH_TYPE - ANY_MATCH_TYPE type: string format: enum name: type: string description: type: string constraints: type: array items: $ref: '#/components/schemas/Constraint' UpdateNamespaceRequest: type: object properties: environmentKey: type: string description: The environment identifier, e.g. 'production'. key: type: string description: The namespace key. name: type: string description: The namespace name. description: type: string description: The namespace description. protected: type: boolean description: The namespace protection status. revision: type: string description: The resource revision for optimistic concurrency. description: The request message for creating or updating a namespace. UpdateResourceRequest: type: object properties: environmentKey: type: string description: The environment identifier, e.g. 'production'. namespaceKey: type: string description: The namespace key for which to list resources, e.g. 'default'. key: type: string description: The resource key. payload: allOf: - $ref: '#/components/schemas/ResourcePayload' description: |- The arbitrary typed resource payload (e.g. flipt.core.Flag, flipt.core.Segment). {"@type": "flipt.core.Flag", "key": "my_flag"} revision: type: string description: The resource revision for optimistic concurrency. description: The request message for creating or updating a resource. Variant: type: object properties: key: type: string name: type: string description: type: string attachment: $ref: '#/components/schemas/GoogleProtobufValue' AtType: required: - '@type' type: object properties: '@type': title: atType enum: - flipt.core.Flag - flipt.core.Segment type: string description: The type of the message. FlagResourcePayload: type: object allOf: - $ref: '#/components/schemas/AtType' - $ref: '#/components/schemas/Flag' description: contains a serialized Flag message with an @type of flipt.core.Flag SegmentResourcePayload: type: object allOf: - $ref: '#/components/schemas/AtType' - $ref: '#/components/schemas/Segment' description: contains a serialized Segment message with an @type of flipt.core.Segment ResourcePayload: type: object oneOf: - $ref: '#/components/schemas/FlagResourcePayload' - $ref: '#/components/schemas/SegmentResourcePayload' description: Contains a Flag or Segment serialized message along with an @type that describes the type of the serialized message. tags: - name: EnvironmentsService