Skip to content

Commit 2012023

Browse files
CaoxuyangXuyang Cao
andauthored
Make the JavaComponent definitions polymorphism and expose fqdn for sba and eureka (#28102)
* Make the JavaComponent definitions polymorphism * fix api version * revert error response change * refine examples * fix default value * fix * fix * try to remove required * try remove require in patch body * fix * try fix lint * fix * add suppression for discriminator * fix --------- Co-authored-by: Xuyang Cao <[email protected]>
1 parent 3cb6f15 commit 2012023

File tree

6 files changed

+160
-58
lines changed

6 files changed

+160
-58
lines changed

specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json

Lines changed: 131 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -401,62 +401,141 @@
401401
"properties": {
402402
"description": "Java Component resource specific properties",
403403
"type": "object",
404-
"properties": {
405-
"componentType": {
406-
"description": "Type of the Java Component.",
407-
"enum": [
408-
"SpringBootAdmin",
409-
"SpringCloudEureka",
410-
"SpringCloudConfig",
411-
"Nacos"
412-
],
413-
"type": "string",
414-
"x-ms-enum": {
415-
"name": "JavaComponentType",
416-
"modelAsString": true
417-
}
418-
},
419-
"provisioningState": {
420-
"description": "Provisioning state of the Java Component.",
421-
"enum": [
422-
"Succeeded",
423-
"Failed",
424-
"Canceled",
425-
"Deleting",
426-
"InProgress"
427-
],
428-
"type": "string",
429-
"readOnly": true,
430-
"x-ms-enum": {
431-
"name": "JavaComponentProvisioningState",
432-
"modelAsString": true
433-
}
434-
},
435-
"configurations": {
436-
"description": "List of Java Components configuration properties",
437-
"type": "array",
438-
"items": {
439-
"$ref": "#/definitions/JavaComponentConfigurationProperty"
440-
},
441-
"x-ms-identifiers": [
442-
"propertyName"
443-
]
444-
},
445-
"serviceBinds": {
446-
"description": "List of Java Components that are bound to the Java component",
447-
"type": "array",
448-
"items": {
449-
"$ref": "#/definitions/JavaComponentServiceBind"
450-
},
451-
"x-ms-identifiers": [
452-
"name"
453-
]
454-
}
404+
"$ref": "#/definitions/JavaComponentProperties"
405+
}
406+
}
407+
},
408+
"JavaComponentProperties": {
409+
"description": "Java Component common properties.",
410+
"type": "object",
411+
"required": [
412+
"componentType"
413+
],
414+
"properties": {
415+
"componentType": {
416+
"description": "Type of the Java Component.",
417+
"enum": [
418+
"SpringBootAdmin",
419+
"SpringCloudEureka",
420+
"SpringCloudConfig",
421+
"Nacos"
422+
],
423+
"type": "string",
424+
"x-ms-enum": {
425+
"name": "JavaComponentType",
426+
"modelAsString": true
427+
}
428+
},
429+
"provisioningState": {
430+
"description": "Provisioning state of the Java Component.",
431+
"enum": [
432+
"Succeeded",
433+
"Failed",
434+
"Canceled",
435+
"Deleting",
436+
"InProgress"
437+
],
438+
"type": "string",
439+
"readOnly": true,
440+
"x-ms-enum": {
441+
"name": "JavaComponentProvisioningState",
442+
"modelAsString": true
443+
}
444+
},
445+
"configurations": {
446+
"description": "List of Java Components configuration properties",
447+
"type": "array",
448+
"items": {
449+
"$ref": "#/definitions/JavaComponentConfigurationProperty"
450+
},
451+
"x-ms-identifiers": [
452+
"propertyName"
453+
]
454+
},
455+
"serviceBinds": {
456+
"description": "List of Java Components that are bound to the Java component",
457+
"type": "array",
458+
"items": {
459+
"$ref": "#/definitions/JavaComponentServiceBind"
455460
},
456-
"x-ms-client-flatten": true
461+
"x-ms-identifiers": [
462+
"name"
463+
]
464+
}
465+
},
466+
"x-ms-client-flatten": true,
467+
"discriminator": "componentType"
468+
},
469+
"JavaComponentIngress": {
470+
"description": "Container App Ingress configuration.",
471+
"type": "object",
472+
"properties": {
473+
"fqdn": {
474+
"description": "Hostname of the Java Component endpoint",
475+
"type": "string",
476+
"readOnly": true
457477
}
458478
}
459479
},
480+
"SpringBootAdminComponent": {
481+
"description": "Spring Boot Admin properties.",
482+
"type": "object",
483+
"allOf": [
484+
{
485+
"$ref": "#/definitions/JavaComponentProperties"
486+
}
487+
],
488+
"properties": {
489+
"ingress": {
490+
"$ref": "#/definitions/JavaComponentIngress",
491+
"description": "Java Component Ingress configurations."
492+
}
493+
},
494+
"x-ms-discriminator-value": "SpringBootAdmin"
495+
},
496+
"NacosComponent": {
497+
"description": "Nacos properties.",
498+
"type": "object",
499+
"allOf": [
500+
{
501+
"$ref": "#/definitions/JavaComponentProperties"
502+
}
503+
],
504+
"properties": {
505+
"ingress": {
506+
"$ref": "#/definitions/JavaComponentIngress",
507+
"description": "Java Component Ingress configurations."
508+
}
509+
},
510+
"x-ms-discriminator-value": "Nacos"
511+
},
512+
"SpringCloudEurekaComponent": {
513+
"description": "Spring Cloud Eureka properties.",
514+
"type": "object",
515+
"allOf": [
516+
{
517+
"$ref": "#/definitions/JavaComponentProperties"
518+
}
519+
],
520+
"properties": {
521+
"ingress": {
522+
"$ref": "#/definitions/JavaComponentIngress",
523+
"description": "Java Component Ingress configurations."
524+
}
525+
},
526+
"x-ms-discriminator-value": "SpringCloudEureka"
527+
},
528+
"SpringCloudConfigComponent": {
529+
"description": "Spring Cloud Config properties.",
530+
"type": "object",
531+
"allOf": [
532+
{
533+
"$ref": "#/definitions/JavaComponentProperties"
534+
}
535+
],
536+
"properties": {},
537+
"x-ms-discriminator-value": "SpringCloudConfig"
538+
},
460539
"JavaComponentsCollection": {
461540
"description": "Java Components ARM resource.",
462541
"required": [

specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
"propertyName": "spring.boot.admin.monitor.status-interval",
4141
"value": "10000ms"
4242
}
43-
]
43+
],
44+
"ingress": {
45+
"fqdn": "myjavacomponent.myenvironment.test.net"
46+
}
4447
}
4548
}
4649
},
@@ -62,7 +65,10 @@
6265
"propertyName": "spring.boot.admin.monitor.status-interval",
6366
"value": "10000ms"
6467
}
65-
]
68+
],
69+
"ingress": {
70+
"fqdn": "myjavacomponent.myenvironment.test.net"
71+
}
6672
}
6773
}
6874
}

specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
"propertyName": "spring.boot.admin.monitor.status-interval",
2626
"value": "10000ms"
2727
}
28-
]
28+
],
29+
"ingress": {
30+
"fqdn": "myjavacomponent.myenvironment.test.net"
31+
}
2932
}
3033
}
3134
}

specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
"propertyName": "spring.boot.admin.monitor.status-interval",
2626
"value": "10000ms"
2727
}
28-
]
28+
],
29+
"ingress": {
30+
"fqdn": "myjavacomponent.myenvironment.test.net"
31+
}
2932
}
3033
},
3134
{
@@ -40,7 +43,10 @@
4043
"propertyName": "spring.cloud.config.server.git.uri",
4144
"value": "<GIT-URL>"
4245
}
43-
]
46+
],
47+
"ingress": {
48+
"fqdn": "myjavacomponent.myenvironment.test.net"
49+
}
4450
}
4551
}
4652
]

specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
"propertyName": "spring.boot.admin.monitor.status-interval",
4141
"value": "10000ms"
4242
}
43-
]
43+
],
44+
"ingress": {
45+
"fqdn": "myjavacomponent.myenvironment.test.net"
46+
}
4447
}
4548
}
4649
},

specification/app/resource-manager/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ input-file:
6363
- Microsoft.App/preview/2024-02-02-preview/Subscriptions.json
6464
- Microsoft.App/preview/2024-02-02-preview/Usages.json
6565
- Microsoft.App/preview/2024-02-02-preview/FunctionsExtension.json
66+
directive:
67+
- suppress: PatchBodyParametersSchema
68+
from: JavaComponents.json
69+
reason: |
70+
Java Component is using componentType as the discriminator. While the discriminator is a required property, this rule prevent it being present in the patch request body.
6671
```
6772
### Tag: package-preview-2023-11
6873

0 commit comments

Comments
 (0)