Skip to content

feat: add bosh-cpi-config.yaml #4703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,11 @@
"fileMatch": [".bowerrc"],
"url": "https://json.schemastore.org/bowerrc.json"
},
{
"name": "BOSH CPI Config",
"description": "CPI-specific config for BOSH Director",
"url": "https://json.schemastore.org/bosh-cpi-config.json"
},
{
"name": "BOSH Deploy Config",
"description": "Deploy config for BOSH CLI",
Expand Down
58 changes: 58 additions & 0 deletions src/schemas/json/bosh-cpi-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/bosh-cpi-config.json",
"$comment": "This schema was built from information on https://bosh.io/docs/cpi-config/ and https://github.com/cloudfoundry/bosh/blob/0bb56927d04d3ce2b7f9d4283a9acd5ee2d6aaf3/src/bosh-director/lib/bosh/director/cpi_config/cpi.rb.",
"$ref": "#/definitions/CPIConfig",
"definitions": {
"CPIConfig": {
"type": "object",
"title": "BOSH Director CPI Config",
"description": "To define CPIs and CPI-specific properties for a BOSH Director.\n\nIntroduced in: v261",
"properties": {
"cpis": {
"type": "array",
"items": {
"$ref": "#/definitions/CPIs"
}
}
}
},
"CPIs": {
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"exec_path": {
"type": "string"
},
"migrated_from": {
"$ref": "#/definitions/MigratedFrom"
},
"properties": {
"type": "object"
}
}
},
"MigratedFrom":{
"type": "array",
"description": "Allows for reusing IaaS resources from existing CPI configurations (such as pre-CPI config by using the special \"\" CPI name) without needing to re-upload stemcells or recreate all resources immediately.\n\nIntroduced in: v262.8.0 (https://github.com/cloudfoundry/bosh/commit/1a98a964f9c0238ba6a9b330e20a266cde9370c0)",
"items": {
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string"
}
}
}
}
}
}
40 changes: 40 additions & 0 deletions src/test/bosh-cpi-config/complex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cpis:
- name: openstack-a1
type: openstack
exec_path: /var/vcap/jobs/openstack_cpi/bin/cpi
migrated_from:
- name: ''
- name: oldenstack
# Taken from: https://github.com/cloudfoundry/bosh-openstack-cpi-release/blob/222b7c0db9341b561ebfcbc817f1fc5b4e314e0d/src/openstack_cpi_golang/cpi/config/config_test.go#L21C1-L28C44
properties:
auth_url: the_auth_url
username: the_username
api_key: the_api_key
domain: the_domain
tenant: the_tenant
region: the_region
default_key_name: the_default_key_name
stemcell_public_visibility": true

- name: vsphere-a1
type: vsphere
# Taken from: https://github.com/cloudfoundry/bosh-vsphere-cpi-release/blob/3a59941b634503c9720c00878105cd74965daac4/src/vsphere_cpi/spec/unit/bosh_release/jobs/cpi/templates/cpi.json.erb_spec.rb#L26-L50
properties:
host: vcenter-address
user: vcenter-user
password: vcenter-password
enable_auto_anti_affinity_drs_rules: true
enable_human_readable_name: true
upgrade_hw_version: true
vm_storage_policy_name: VM Storage Policy
http_logging: true
datacenters:
- name: datacenter-1
vm_folder: vm-folder
template_folder: template-folder
datastore_pattern: datastore-pattern
datastore_cluster_pattern: datastore-cluster-pattern
persistent_datastore_pattern: persistent-datastoreppattern
persistent_datastore_cluster_pattern: persistent-datastore-cluster-pattern
disk_path: disk-path
clusters: [cluster-1]
3 changes: 3 additions & 0 deletions src/test/bosh-cpi-config/minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cpis:
- name: openstack-a1
type: openstack
Loading