CloudConfig toplevel property hovers

This commit is contained in:
Kris De Volder
2017-08-08 11:07:45 -07:00
parent b5d4adcf95
commit 157b121ffa
8 changed files with 106 additions and 8 deletions

View File

@@ -27,12 +27,12 @@ public class BoshCloudConfigSchema extends SchemaSupport implements YamlSchema {
t_any = f.yany("Object");
this.toplevelType = f.ybean("CloudConfig");
addProp(toplevelType, "azs", t_any);
addProp(toplevelType, "networks", t_any);
addProp(toplevelType, "vm_types", t_any);
addProp(toplevelType, "azs", t_any).isRequired(true);
addProp(toplevelType, "networks", t_any).isRequired(true);
addProp(toplevelType, "vm_types", t_any).isRequired(true);
addProp(toplevelType, "vm_extensions", t_any);
addProp(toplevelType, "disk_types", t_any);
addProp(toplevelType, "compilation", t_any);
addProp(toplevelType, "disk_types", t_any).isRequired(true);
addProp(toplevelType, "compilation", t_any).isRequired(true);
}
@Override
@@ -47,6 +47,6 @@ public class BoshCloudConfigSchema extends SchemaSupport implements YamlSchema {
@Override
protected String getResourcePathPrefix() {
return "cloud-config";
return "/cloud-config/";
}
}

View File

@@ -31,7 +31,7 @@ public class SchemaSupport {
}
protected String getResourcePathPrefix() {
return "desc";
return "/desc/";
}
protected YTypedPropertyImpl prop(AbstractType beanType, String name, YType type) {
@@ -42,7 +42,7 @@ public class SchemaSupport {
protected Renderable descriptionFor(YType owner, String propName) {
String typeName = owner.toString();
return Renderables.fromClasspath(BoshDeploymentManifestSchema.class, getResourcePathPrefix()+typeName+"/"+propName);
return Renderables.fromClasspath(SchemaSupport.class, getResourcePathPrefix()+typeName+"/"+propName);
}
protected YTypedPropertyImpl addProp(AbstractType bean, String name, YType type) {

View File

@@ -0,0 +1,23 @@
*Required*. Specifies the AZs available to deployments. At least one should be specified.
See [first class AZs](https://bosh.io/docs/azs.html) for more details.
Example:
azs:
- name: z1
cloud_properties:
availability_zone: us-east-1c
- name: z2
cloud_properties:
availability_zone: us-east-1d
CPI Specific `cloud_properties`.
- See [AWS CPI AZ cloud properties](https://bosh.io/docs/aws-cpi.html#azs).
- See [Azure CPI AZ cloud properties](https://bosh.io/docs/azure-cpi.html#azs").
- See [OpenStack CPI AZ cloud properties](https://bosh.io/docks/openstack-cpi.html#azs).
- See [Softlayer CPI AZ cloud properties](https://bosh.io/docks/softlayer-cpi.html#azs).
- See [Google Cloud Platform CPI AZ cloud properties](https://bosh.io/docks/google-cpi.html#azs).
- See [vSphere CPI AZ cloud properties](https://bosh.io/docks/vsphere-cpi.html#azs).
- See [See vCloud CPI AZ cloud properties](https://bosh.io/docks/vcloud-cpi.html#azs).

View File

@@ -0,0 +1,10 @@
*Require*. The Director creates compilation VMs for release compilation. The Director will compile each release on every necessary stemcell used in a deployment. A compilation definition allows to specify VM characteristics.
Example:
compilation:
workers: 2
reuse_compilation_vms: true
az: z1
vm_type: default
network: private

View File

@@ -0,0 +1,19 @@
*Required*. Specifies the [disk types](https://bosh.io/docs/terminology.html#disk-types) available to deployments. At least one should be specified.
Example:
disk_types:
- name: default
disk_size: 2
cloud_properties:
type: gp2
CPI Specific `cloud_properties`
- See [AWS CPI disk type cloud properties](https://bosh.io/docs/aws-cpi.html#disk-pools)
- See [Azure CPI disk type cloud properties](https://bosh.io/docs/azure-cpi.html#disk-pools)
- See [OpenStack CPI disk type cloud properties](https://bosh.io/docs/openstack-cpi.html#disk-pools)
- See [Softlayer CPI disk type cloud properties](https://bosh.io/docs/softlayer-cpi.html#disk-pools)
- See [Google Cloud Platform CPI disk type cloud properties](https://bosh.io/docs/google-cpi.html#disk-pools)
- See [vSphere CPI disk type cloud properties](https://bosh.io/docs/vsphere-cpi.html#disk-pools)
- See [vCloud CPI disk type cloud properties](https://bosh.io/docs/vcloud-cpi.html#disk-pools)

View File

@@ -0,0 +1,13 @@
*required*. Each sub-block listed in the Networks block specifies a network configuration that jobs can reference. There are three different network types: `manual`, `dynamic`, and `vip`. At least one should be specified.
See [networks](https://bosh.io/docs/networks.html) for more details.
CPI Specific `cloud_properties`
- See [AWS CPI network cloud properties](https://bosh.io/docs/aws-cpi.html#networks)
- See [Azure CPI network cloud properties](https://bosh.io/docs/azure-cpi.html#networks)
- See [OpenStack CPI network cloud properties](https://bosh.io/docs/openstack-cpi.html#networks)
- See [Softlayer CPI network cloud properties](https://bosh.io/docs/softlayer-cpi.html#networks)
- See [Google Cloud Plaform CPI network cloud properties](https://bosh.io/docs/google-cpi.html#networks)
- See [vSphere CPI network cloud properties](https://bosh.io/docs/vsphere-cpi.html#networks)
- See [vCloud CPI network cloud properties](https://bosh.io/docs/vcloud-cpi.html#networks)

View File

@@ -0,0 +1,18 @@
*Required*. Specifies the [VM types](https://bosh.io/docs/terminology.html#vm-type) available to deployments. At least one should be specified.
Example:
vm_types:
- name: default
cloud_properties:
instance_type: m1.small
CPI Specific `cloud_properties`
- See [AWS CPI VM types cloud properties](https://bosh.io/docs/aws-cpi.html#resource-pools)
- See [Azure CPI VM types cloud properties](https://bosh.io/docs/azure-cpi.html#resource-pools)
- See [OpenStack CPI VM types cloud properties](https://bosh.io/docs/openstack-cpi.html#resource-pools)
- See [Softlayer CPI VM types cloud properties](https://bosh.io/docs/softlayer-cpi.html#resource-pools)
- See [Google Cloud Platform CPI VM types cloud properties](https://bosh.io/docs/google-cpi.html#resource-pools)
- See [vSphere CPI VM types cloud properties](https://bosh.io/docs/vsphere-cpi.html#resource-pools)
- See [vCloud CPI VM types cloud properties](https://bosh.io/docs/vcloud-cpi.html#resource-pools)

View File

@@ -1895,4 +1895,19 @@ public class BoshEditorTest {
editor.assertProblems("bogus|Unknown property");
}
@Test public void cloudconfig_toplevel_hovers() throws Exception {
Editor editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG,
"azs: []\n" +
"vm_types: []\n" +
"disk_types: []\n" +
"networks: []\n" +
"compilation: {}\n"
);
editor.assertHoverContains("azs", "Specifies the AZs available to deployments.");
editor.assertHoverContains("networks", "specifies a network configuration that jobs can reference.");
editor.assertHoverContains("vm_types", "Specifies the [VM types](https://bosh.io/docs/terminology.html#vm-type) available to deployments.");
editor.assertHoverContains("disk_types", "Specifies the [disk types](https://bosh.io/docs/terminology.html#disk-types) available to deployments.");
editor.assertHoverContains("compilation", "A compilation definition allows to specify VM characteristics.");
}
}