Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

State File Schema

Raw JSON schema

Open JSON schema file

Examples

Empty State

{ "_type": "nixopsState", "resources": {}, "deployments": {} }

NixOps4 State Event/File Schema

Raw JSON schema

Title: NixOps4 State Event/File Schema

Typecombining
RequiredNo
Additional propertiesAny type allowed

Description: This schema describes the shape of state events and the cumulative state file. The state file is a JSON file that contains the current state of the NixOps4 deployment. The state events are a sequence of changes to the state file, and are used to track the history of the deployment.

One of(Option)
StateEvent
State

1. Property StateEvent

Typeobject
RequiredNo
Additional propertiesAny type allowed
Defined in#/definitions/StateEvent
PropertyTypePatternTitle/Description
+ indexintegerNoThe index of the event. This should be a monotonically increasing number that is used to order the events. A lack of monotonicity indicates concurrent operations that may need manual reconciliation.
+ metaobjectNo-
+ patcharrayNoJSON Patch

1.1. Property index

Typeinteger
RequiredYes

Description: The index of the event. This should be a monotonically increasing number that is used to order the events. A lack of monotonicity indicates concurrent operations that may need manual reconciliation.

1.2. Property meta

Typeobject
RequiredYes
Additional propertiesAny type allowed
PropertyTypePatternTitle/Description
+ timestringNoThe time at which the event occurred.
-objectNo-
1.2.1. Property time
Typestring
RequiredYes
Formatdate-time

Description: The time at which the event occurred.

1.3. Property patch

Title: JSON Patch

Typearray
RequiredYes
Defined in#/definitions/Patch

Description: An RFC 6902 JSON Patch document. See https://tools.ietf.org/html/rfc6902, https://json.schemastore.org/json-patch.json

Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
patch items-
1.3.1. patch items
Typecombining
RequiredNo
Additional propertiesAny type allowed
One of(Option)
item 0
item 1
item 2
1.3.1.1. Property item 0
Typeobject
RequiredNo
Additional propertiesNot allowed
PropertyTypePatternTitle/Description
+ pathstringNoA JSON Pointer path.
+ openum (of string)NoThe operation to perform.
+ valueobjectNoThe value to add, replace or test.

####### 1.3.1.1.1. Property path

Typestring
RequiredYes
Defined in#/definitions/path

Description: A JSON Pointer path.

Restrictions
Must match regular expression^#?(|(/([^/~]|~[01])*)*)$ Test

####### 1.3.1.1.2. Property op

Typeenum (of string)
RequiredYes

Description: The operation to perform.

Must be one of:

  • "add"
  • "replace"
  • "test"

####### 1.3.1.1.3. Property value

Typeobject
RequiredYes
Additional propertiesAny type allowed

Description: The value to add, replace or test.

1.3.1.2. Property item 1
Typeobject
RequiredNo
Additional propertiesNot allowed
PropertyTypePatternTitle/Description
+ pathstringNoA JSON Pointer path.
+ openum (of string)NoThe operation to perform.

####### 1.3.1.2.1. Property path

Typestring
RequiredYes
Same definition aspath

Description: A JSON Pointer path.

####### 1.3.1.2.2. Property op

Typeenum (of string)
RequiredYes

Description: The operation to perform.

Must be one of:

  • "remove"
1.3.1.3. Property item 2
Typeobject
RequiredNo
Additional propertiesNot allowed
PropertyTypePatternTitle/Description
+ pathstringNoA JSON Pointer path.
+ openum (of string)NoThe operation to perform.
+ fromstringNoA JSON Pointer path pointing to the location to move/copy from.

####### 1.3.1.3.1. Property path

Typestring
RequiredYes
Same definition aspath

Description: A JSON Pointer path.

####### 1.3.1.3.2. Property op

Typeenum (of string)
RequiredYes

Description: The operation to perform.

Must be one of:

  • "move"
  • "copy"

####### 1.3.1.3.3. Property from

Typestring
RequiredYes
Defined in#/definitions/path

Description: A JSON Pointer path pointing to the location to move/copy from.

Restrictions
Must match regular expression^#?(|(/([^/~]|~[01])*)*)$ Test

2. Property State

Typeobject
RequiredNo
Additional propertiesAny type allowed
Defined in#/definitions/State
PropertyTypePatternTitle/Description
+ _typeenum (of string)NoThe type of the state. This is used to distinguish the format of the NixOps state. Currently only one type has been developed: `nixopsState`. Any code that reads the state should reject any other type.
+ resourcesobjectNo-
+ deploymentsobjectNoA set of nested deployments, TBD

2.1. Property _type

Typeenum (of string)
RequiredYes

Description: The type of the state. This is used to distinguish the format of the NixOps state. Currently only one type has been developed: nixopsState. Any code that reads the state should reject any other type.

Must be one of:

  • "nixopsState"

2.2. Property resources

Typeobject
RequiredYes
Additional propertiesAny type allowed
PropertyTypePatternTitle/Description
-objectNo-

2.3. Property deployments

Typeobject
RequiredYes
Additional propertiesAny type allowed

Description: A set of nested deployments, TBD