-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Spring Cloud] Integrate tanzu components with service and app #4300
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3f64063
resolve conflict
ninpan-ms a66ff47
Update config_file_patterns None
ninpan-ms 062c22b
Update kwargs
ninpan-ms 5846335
Update kwargs
ninpan-ms e7fa510
linter check
ninpan-ms e045ccb
fix test
ninpan-ms cad1a4d
Add test
ninpan-ms 772dda8
Add validate for parameters
ninpan-ms 9114b07
fix
ninpan-ms fc32551
fix test
ninpan-ms 5488c18
fix
ninpan-ms 13d724a
fix comment
ninpan-ms 56bc967
fix test
ninpan-ms 99b0722
Add warning when clear patterns
ninpan-ms 3b6f231
fix transformer
ninpan-ms 4238246
fix type of properties
ninpan-ms baaccba
fix lint
ninpan-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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,63 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: disable=too-few-public-methods, unused-argument, redefined-builtin | ||
|
||
from azure.cli.core.commands.client_factory import get_subscription_id | ||
from knack.log import get_logger | ||
from msrestazure.tools import resource_id | ||
|
||
from .vendored_sdks.appplatform.v2022_01_01_preview import models | ||
|
||
GATEWAY_RESOURCE_TYPE = "gateways" | ||
DEFAULT_NAME = "default" | ||
logger = get_logger(__name__) | ||
|
||
|
||
def create_application_configuration_service(cmd, client, resource_group, service, enable_application_configuration_service, **_): | ||
if enable_application_configuration_service: | ||
logger.warning(" - Creating Application Configuration Service ..") | ||
acs_resource = models.ConfigurationServiceResource() | ||
return client.configuration_services.begin_create_or_update(resource_group, service, DEFAULT_NAME, acs_resource) | ||
|
||
|
||
def create_service_registry(cmd, client, resource_group, service, enable_service_registry, **_): | ||
if enable_service_registry: | ||
logger.warning(" - Creating Service Registry ..") | ||
return client.service_registries.begin_create_or_update(resource_group, service, DEFAULT_NAME) | ||
|
||
|
||
def create_gateway(cmd, client, resource_group, service, enable_gateway, gateway_instance_count=None, sku=None, **_): | ||
if enable_gateway: | ||
logger.warning(" - Creating Spring Cloud Gateway ..") | ||
gateway_resource = models.GatewayResource() | ||
if gateway_instance_count and sku: | ||
gateway_resource.sku = models.Sku(name=sku.name, tier=sku.tier, | ||
capacity=gateway_instance_count) | ||
return client.gateways.begin_create_or_update(resource_group, service, DEFAULT_NAME, gateway_resource) | ||
|
||
|
||
def create_api_portal(cmd, client, resource_group, service, enable_api_portal, api_portal_instance_count=None, sku=None, **_): | ||
if enable_api_portal: | ||
logger.warning(" - Creating API portal ..") | ||
gateway_id = resource_id( | ||
subscription=get_subscription_id(cmd.cli_ctx), | ||
resource_group=resource_group, | ||
namespace='Microsoft.AppPlatform', | ||
type='Spring', | ||
name=service, | ||
child_type_1=GATEWAY_RESOURCE_TYPE, | ||
child_name_1=DEFAULT_NAME | ||
) | ||
|
||
api_portal_resource = models.ApiPortalResource( | ||
properties=models.ApiPortalProperties( | ||
gateway_ids=[gateway_id] | ||
) | ||
) | ||
if api_portal_instance_count and sku: | ||
api_portal_resource.sku = models.Sku(name=sku.name, tier=sku.tier, | ||
capacity=api_portal_instance_count) | ||
return client.api_portals.begin_create_or_update(resource_group, service, DEFAULT_NAME, api_portal_resource) |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no service registry body, is this on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's expected