diff --git a/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshCloudConfigSchema.java b/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshCloudConfigSchema.java index 1375b34f6..541487158 100644 --- a/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshCloudConfigSchema.java +++ b/headless-services/bosh-language-server/src/main/java/org/springframework/ide/vscode/bosh/BoshCloudConfigSchema.java @@ -83,7 +83,7 @@ public class BoshCloudConfigSchema extends SchemaSupport implements YamlSchema { YType t_network = createNetworkBlockSchema(models); YBeanType t_az = f.ybean("AZ"); - addProp(t_az, "name", t_az_def).isRequired(true); + addProp(t_az, "name", t_az_def).isPrimary(true); addProp(t_az, "cloud_properties", t_params); YBeanType t_compilation = f.ybean("Compilation"); diff --git a/headless-services/bosh-language-server/src/main/resources/cloud-config/AZ/cloud_properties.md b/headless-services/bosh-language-server/src/main/resources/cloud-config/AZ/cloud_properties.md new file mode 100644 index 000000000..962694749 --- /dev/null +++ b/headless-services/bosh-language-server/src/main/resources/cloud-config/AZ/cloud_properties.md @@ -0,0 +1,11 @@ +Describes any IaaS-specific properties needed to associated with AZ; for most IaaSes, some data here is actually required. Example: `availability_zone`. Default is `{}` (empty Hash). + +See: + +- [AWS CPI AZ cloud properties](https://bosh.io/docs/aws-cpi.html#azs) +- [Azure CPI AZ cloud properties](https://bosh.io/docs/azure-cpi.html#azs) +- [OpenStack CPI AZ cloud properties](https://bosh.io/docs/openstack-cpi.html#azs) +- [Softlayer CPI AZ cloud properties](https://bosh.io/docs/softlayer-cpi.html#azs) +- [Google Cloud Platform CPI AZ cloud properties](https://bosh.io/docs/google-cpi.html#azs) +- [vSphere CPI AZ cloud properties](https://bosh.io/docs/vsphere-cpi.html#azs) +- [vCloud CPI AZ cloud properties](https://bosh.io/docs/vcloud-cpi.html#azs) diff --git a/headless-services/bosh-language-server/src/main/resources/cloud-config/AZ/name.md b/headless-services/bosh-language-server/src/main/resources/cloud-config/AZ/name.md new file mode 100644 index 000000000..f8e411ad9 --- /dev/null +++ b/headless-services/bosh-language-server/src/main/resources/cloud-config/AZ/name.md @@ -0,0 +1 @@ +*Required*. Name of an AZ within the Director. \ No newline at end of file diff --git a/headless-services/bosh-language-server/src/test/java/org/springframework/ide/vscode/bosh/BoshEditorTest.java b/headless-services/bosh-language-server/src/test/java/org/springframework/ide/vscode/bosh/BoshEditorTest.java index baed77979..745873b9a 100644 --- a/headless-services/bosh-language-server/src/test/java/org/springframework/ide/vscode/bosh/BoshEditorTest.java +++ b/headless-services/bosh-language-server/src/test/java/org/springframework/ide/vscode/bosh/BoshEditorTest.java @@ -2358,4 +2358,32 @@ public class BoshEditorTest { editor.assertProblems("bad-network|unknown 'NetworkName'"); } + @Test public void cloudconfig_network_azs_ca() throws Exception { + Editor editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, + "azs:\n" + + "- <*>" + ); + editor.assertContextualCompletions("<*>", + "name: <*>" + ); + + editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, + "azs:\n" + + "- name: the-zone\n" + + " <*>" + ); + editor.assertContextualCompletions(PLAIN_COMPLETION, "<*>", + "cloud_properties:\n" + + " <*>" + ); + + editor = harness.newEditor(LanguageId.BOSH_CLOUD_CONFIG, + "azs:\n" + + "- name: the-zone\n" + + " cloud_properties: {}\n" + ); + editor.assertHoverContains("name", "Name of an AZ within the Director"); + editor.assertHoverContains("cloud_properties", "Describes any IaaS-specific properties needed to associated with AZ"); + } + }