Skip to content
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

Mgmt Container Instance migration and update #13371

Merged
merged 36 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d6c0a1a
move aci from azure-libraries
ChenTanyi Jul 15, 2020
a648e2f
update pom
ChenTanyi Jul 15, 2020
218de00
refactor namespace
ChenTanyi Jul 15, 2020
fc1f959
update api-specs
ChenTanyi Jul 15, 2020
61d548b
regen aci
ChenTanyi Jul 15, 2020
261550f
refactor manager
ChenTanyi Jul 15, 2020
b4dc7d8
remove method beta
ChenTanyi Jul 16, 2020
df7696e
fix models type
ChenTanyi Jul 16, 2020
66b1326
fix manager and some import error
ChenTanyi Jul 16, 2020
400f49a
fix compile error
ChenTanyi Jul 17, 2020
2d2b97e
add aci in azure
ChenTanyi Jul 17, 2020
fb62cb8
fix compile error
ChenTanyi Jul 17, 2020
33063cf
move sample
ChenTanyi Jul 17, 2020
024f1c6
fix compile error
ChenTanyi Jul 17, 2020
27cc3b1
update api version
ChenTanyi Jul 17, 2020
1a89032
regen
ChenTanyi Jul 17, 2020
1700751
update manager dependency
ChenTanyi Jul 17, 2020
fc19912
remove inner
ChenTanyi Jul 17, 2020
259e41d
regen
ChenTanyi Jul 17, 2020
426d790
fix compile error
ChenTanyi Jul 17, 2020
c6f5cde
add subnet delegation
ChenTanyi Jul 20, 2020
62e71be
add virtual network interface
ChenTanyi Jul 20, 2020
df51955
add test for virtual network
ChenTanyi Jul 20, 2020
8ff546d
add session record for virtual network
ChenTanyi Jul 20, 2020
d36e781
fix test error
ChenTanyi Jul 21, 2020
05a8d8a
update session-record
ChenTanyi Jul 21, 2020
49dd380
format
ChenTanyi Jul 21, 2020
47d906a
format azure package
ChenTanyi Jul 21, 2020
663fd44
auto fix some checkstyle
ChenTanyi Jul 21, 2020
2fff63b
fix verify error
ChenTanyi Jul 21, 2020
a8d2e3c
change sample test to live only
ChenTanyi Jul 21, 2020
3f92a3e
add withExistingNetworkProfile and withNewNetworkProfileOnExistingVir…
ChenTanyi Jul 21, 2020
198e80d
fix compile error
ChenTanyi Jul 21, 2020
dd50580
remove Beta
ChenTanyi Jul 21, 2020
a3af859
remove unused import
ChenTanyi Jul 21, 2020
f80cf71
fix checkstyle
ChenTanyi Jul 21, 2020
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
Prev Previous commit
Next Next commit
add withExistingNetworkProfile and withNewNetworkProfileOnExistingVir…
…tualNetwork
  • Loading branch information
ChenTanyi committed Jul 21, 2020
commit 3f92a3eab173dcc211e4b698ca1ca9508d64101a
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public ContainerGroupImpl withDnsPrefix(String dnsPrefix) {
}

@Override
public ContainerGroupImpl withNetworkProfileId(
public ContainerGroupImpl withExistingNetworkProfile(
String subscriptionId, String resourceGroupName, String networkProfileName) {
String networkProfileId =
"/subscriptions/"
Expand All @@ -448,6 +448,11 @@ public ContainerGroupImpl withNetworkProfileId(
+ resourceGroupName
+ "/providers/Microsoft.Network/networkProfiles/"
+ networkProfileName;
return this.withExistingNetworkProfile(networkProfileId);
}

@Override
public ContainerGroupImpl withExistingNetworkProfile(String networkProfileId) {
this.inner().withNetworkProfile(new ContainerGroupNetworkProfile().withId(networkProfileId));
if (this.inner().ipAddress() == null) {
this.inner().withIpAddress(new IpAddress());
Expand All @@ -457,7 +462,8 @@ public ContainerGroupImpl withNetworkProfileId(
}

@Override
public ContainerGroupImpl withExistingVirtualNetwork(String virtualNetworkId, String subnetName) {
public ContainerGroupImpl withNewNetworkProfileOnExistingVirtualNetwork(
String virtualNetworkId, String subnetName) {
creatableNetworkProfileName = manager().sdkContext().randomResourceName("aci-profile-", 20);
String subnetId = String.format("%s/subnets/%s", virtualNetworkId, subnetName);
SubnetInner subnetInner = new SubnetInner();
Expand All @@ -477,7 +483,8 @@ public ContainerGroupImpl withExistingVirtualNetwork(String virtualNetworkId, St
.withSubnet(subnetInner)))));
creatableNetworkProfileInner.withLocation(regionName());

return this.withNetworkProfileId(manager().subscriptionId(), resourceGroupName(), creatableNetworkProfileName);
return this.withExistingNetworkProfile(
manager().subscriptionId(), resourceGroupName(), creatableNetworkProfileName);
}

@Override
Expand All @@ -503,7 +510,7 @@ public ContainerGroupImpl withNewVirtualNetwork(String addressSpace) {
.format(
"/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s",
manager().subscriptionId(), resourceGroupName(), virtualNetworkName);
return withExistingVirtualNetwork(virtualNetworkId, subnetName);
return withNewNetworkProfileOnExistingVirtualNetwork(virtualNetworkId, subnetName);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1020,18 +1020,26 @@ interface WithNetworkProfile {
* @param networkProfileName the name of the network profile
* @return the next stage of the definition
*/
DnsConfigFork withNetworkProfileId(
DnsConfigFork withExistingNetworkProfile(
String subscriptionId, String resourceGroupName, String networkProfileName);

/**
* Specifies the network profile information for a container group.
*
* @param networkProfileId the ID of the network profile
* @return the next stage of the definition
*/
DnsConfigFork withExistingNetworkProfile(String networkProfileId);

/**
* Specifies the virtual network in network profile for a container group.
*
* @param virtualNetworkId the ID of the virtual network
* @param subnetName the name of the subnet within the virtual network.; the subnet must have the service
* endpoints enabled for 'Microsoft.ContainerInstance/containerGroups'.
* @param subnetName the name of the subnet within the virtual network.;
* the subnet must have delegation for 'Microsoft.ContainerInstance/containerGroups'.
* @return the next stage of the definition
*/
DnsConfigFork withExistingVirtualNetwork(String virtualNetworkId, String subnetName);
DnsConfigFork withNewNetworkProfileOnExistingVirtualNetwork(String virtualNetworkId, String subnetName);

/**
* Creates a new virtual network to associate with network profile in a container group.
Expand Down