-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schema): add schema validation for install plans
- Loading branch information
1 parent
930a52a
commit ffde666
Showing
2 changed files
with
358 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,353 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "install_config.json", | ||
"type": "object", | ||
"title": "The root schema", | ||
"description": "The root schema comprises the entire JSON document.", | ||
"default": {}, | ||
"examples": [ | ||
{ | ||
"id": "infra-agent-standard", | ||
"title": "Infrastructure Agent Install", | ||
"description": "New Relic's infrastructure monitoring agent is a lightweight executable file that collects data about your hosts. It also forwards data from infrastructure integrations to New Relic, as well as log data for log analytics.", | ||
"target": { | ||
"type": "agent", | ||
"destination": "host", | ||
"os": [ | ||
"darwin", | ||
"linux", | ||
"windows" | ||
], | ||
"context": "markdown content" | ||
}, | ||
"install": { | ||
"mode": "targetedInstall", | ||
"destination": { | ||
"recipeName": "infrastructure-agent-installer", | ||
"nerdletId": "setup-nerdlets.setup-python-integration", | ||
"url": "https://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install/#install" | ||
} | ||
}, | ||
"fallback": { | ||
"mode": "targetedInstall", | ||
"destination": { | ||
"recipeName": "infrastructure-agent-installer", | ||
"nerdletId": "setup-nerdlets.setup-python-integration", | ||
"url": "https://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install/#install" | ||
} | ||
} | ||
} | ||
], | ||
"required": [ | ||
"id", | ||
"target", | ||
"install" | ||
], | ||
"properties": { | ||
"id": { | ||
"$id": "#/properties/id", | ||
"type": "string", | ||
"title": "The id schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"infra-agent-standard" | ||
] | ||
}, | ||
"title": { | ||
"$id": "#/properties/title", | ||
"type": "string", | ||
"title": "The title schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"Infrastructure Agent Install" | ||
] | ||
}, | ||
"description": { | ||
"$id": "#/properties/description", | ||
"type": "string", | ||
"title": "The description schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"New Relic's infrastructure monitoring agent is a lightweight executable file that collects data about your hosts. It also forwards data from infrastructure integrations to New Relic, as well as log data for log analytics." | ||
] | ||
}, | ||
"target": { | ||
"$id": "#/properties/target", | ||
"type": "object", | ||
"title": "The target schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": {}, | ||
"examples": [ | ||
{ | ||
"type": "agent", | ||
"destination": "host", | ||
"os": [ | ||
"darwin", | ||
"linux", | ||
"windows" | ||
], | ||
"context": "markdown content" | ||
} | ||
], | ||
"required": [ | ||
"type", | ||
"destination" | ||
], | ||
"properties": { | ||
"type": { | ||
"$id": "#/properties/target/properties/type", | ||
"type": "string", | ||
"title": "The type schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"enum": [ | ||
"agent", | ||
"integration", | ||
"on-host-integration", | ||
"pixie", | ||
"unknown" | ||
], | ||
"default": "", | ||
"examples": [ | ||
"agent" | ||
] | ||
}, | ||
"destination": { | ||
"$id": "#/properties/target/properties/destination", | ||
"type": "string", | ||
"title": "The destination schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"enum": [ | ||
"application", | ||
"cloud", | ||
"host", | ||
"kubernetes", | ||
"unknown" | ||
], | ||
"default": "", | ||
"examples": [ | ||
"host" | ||
] | ||
}, | ||
"os": { | ||
"$id": "#/properties/target/properties/os", | ||
"type": "array", | ||
"title": "The os schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": [], | ||
"examples": [ | ||
[ | ||
"darwin", | ||
"linux" | ||
] | ||
], | ||
"items": { | ||
"$id": "#/properties/target/properties/os/items", | ||
"anyOf": [ | ||
{ | ||
"$id": "#/properties/target/properties/os/items/anyOf/0", | ||
"type": "string", | ||
"title": "The first anyOf schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"enum": [ | ||
"darwin", | ||
"linux", | ||
"windows" | ||
], | ||
"default": "", | ||
"examples": [ | ||
"darwin", | ||
"linux" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"context": { | ||
"$id": "#/properties/target/properties/context", | ||
"type": "string", | ||
"title": "The context schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"markdown content" | ||
] | ||
} | ||
} | ||
}, | ||
"install": { | ||
"$id": "#/properties/install", | ||
"type": "object", | ||
"title": "The install schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": {}, | ||
"examples": [ | ||
{ | ||
"mode": "targetedInstall", | ||
"destination": { | ||
"recipeName": "infrastructure-agent-installer", | ||
"nerdletId": "setup-nerdlets.setup-python-integration", | ||
"url": "https://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install/#install" | ||
} | ||
} | ||
], | ||
"required": [ | ||
"mode", | ||
"destination" | ||
], | ||
"properties": { | ||
"mode": { | ||
"$id": "#/properties/install/properties/mode", | ||
"type": "string", | ||
"title": "The mode schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"enum": [ | ||
"guidedInstall", | ||
"targetedInstall", | ||
"nerdlet", | ||
"link" | ||
], | ||
"default": "", | ||
"examples": [ | ||
"targetedInstall" | ||
] | ||
}, | ||
"destination": { | ||
"$id": "#/properties/install/properties/destination", | ||
"type": "object", | ||
"title": "The destination schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": {}, | ||
"examples": [ | ||
{ | ||
"recipeName": "infrastructure-agent-installer", | ||
"nerdletId": "setup-nerdlets.setup-python-integration", | ||
"url": "https://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install/#install" | ||
} | ||
], | ||
"required": [], | ||
"properties": { | ||
"recipeName": { | ||
"$id": "#/properties/install/properties/destination/properties/recipeName", | ||
"type": "string", | ||
"title": "The recipeName schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"infrastructure-agent-installer" | ||
] | ||
}, | ||
"nerdletId": { | ||
"$id": "#/properties/install/properties/destination/properties/nerdletId", | ||
"type": "string", | ||
"title": "The nerdletId schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"setup-nerdlets.setup-python-integration" | ||
] | ||
}, | ||
"url": { | ||
"$id": "#/properties/install/properties/destination/properties/url", | ||
"type": "string", | ||
"title": "The url schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"https://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install/#install" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"fallback": { | ||
"$id": "#/properties/fallback", | ||
"type": "object", | ||
"title": "The fallback schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": {}, | ||
"examples": [ | ||
{ | ||
"mode": "targetedInstall", | ||
"destination": { | ||
"recipeName": "infrastructure-agent-installer", | ||
"nerdletId": "setup-nerdlets.setup-python-integration", | ||
"url": "https://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install/#install" | ||
} | ||
} | ||
], | ||
"required": [ | ||
"mode", | ||
"destination" | ||
], | ||
"properties": { | ||
"mode": { | ||
"$id": "#/properties/fallback/properties/mode", | ||
"type": "string", | ||
"title": "The mode schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"enum": [ | ||
"guidedInstall", | ||
"targetedInstall", | ||
"nerdlet", | ||
"link" | ||
], | ||
"default": "", | ||
"examples": [ | ||
"targetedInstall" | ||
] | ||
}, | ||
"destination": { | ||
"$id": "#/properties/fallback/properties/destination", | ||
"type": "object", | ||
"title": "The destination schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": {}, | ||
"examples": [ | ||
{ | ||
"recipeName": "infrastructure-agent-installer", | ||
"nerdletId": "setup-nerdlets.setup-python-integration", | ||
"url": "https://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install/#install" | ||
} | ||
], | ||
"required": [], | ||
"properties": { | ||
"recipeName": { | ||
"$id": "#/properties/fallback/properties/destination/properties/recipeName", | ||
"type": "string", | ||
"title": "The recipeName schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"infrastructure-agent-installer" | ||
] | ||
}, | ||
"nerdletId": { | ||
"$id": "#/properties/fallback/properties/destination/properties/nerdletId", | ||
"type": "string", | ||
"title": "The nerdletId schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"setup-nerdlets.setup-python-integration" | ||
] | ||
}, | ||
"url": { | ||
"$id": "#/properties/fallback/properties/destination/properties/url", | ||
"type": "string", | ||
"title": "The url schema", | ||
"description": "An explanation about the purpose of this instance.", | ||
"default": "", | ||
"examples": [ | ||
"https://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install/#install" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters