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

Fix DeleteOptions on Public Ip Address (issue#38806) #39096

Merged
merged 12 commits into from
Mar 27, 2024

Conversation

v-hongli1
Copy link
Contributor

@v-hongli1 v-hongli1 commented Mar 6, 2024

relate to issue#38806

Fixed files:

  • sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceImpl.java
  • sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationImpl.java
  • sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterface.java
  • sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfiguration.java
  • sdk/resourcemanager/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkInterfaceOperationsTests.java

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@github-actions github-actions bot added the Mgmt This issue is related to a management-plane library. label Mar 6, 2024
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

com.azure.resourcemanager:azure-resourcemanager-network

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Mar 12, 2024

Candidate API design.

// create
// primary
.withPrimaryPublicIPAddressDeleteOptions(..)
// secondary
.defineSecondaryIPConfiguration(name)
    .withDeleteOptions(..)
    .attach()
 
// update
.withPrimaryPublicIPAddressDeleteOptions(..)
.defineSecondaryIPConfiguration(name)
    .withDeleteOptions(..)
    .attach()
// above part is same as create
// update DeleteOptions on existing nic configuration
.updateSecondaryIPConfiguration()
    .withDeleteOptions(..)
    .update()

Having withPrimaryPublicIPAddressDeleteOptions is mainly to avoid overloading every API relates to create of PrimaryPublicIPAddress nic.

We seem not having updateSecondaryIPConfiguration now.

Fix DeleteOptions on Public Ip Address (issue#38806 NetworkInterface fix only)
@Azure Azure deleted a comment from azure-pipelines bot Mar 18, 2024
@v-hongli1 v-hongli1 force-pushed the issue#38806_nic branch 2 times, most recently from ddf9517 to efbb9da Compare March 18, 2024 09:10
@v-hongli1 v-hongli1 force-pushed the issue#38806_nic branch 3 times, most recently from 7d4aef3 to 60192b2 Compare March 27, 2024 02:00
Copy link
Contributor

@XiaofeiCao XiaofeiCao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@weidongxu-microsoft @haolingdong-msft for feedback as well

Copy link
Contributor

@XiaofeiCao XiaofeiCao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also include changelog

Copy link
Member

@weidongxu-microsoft weidongxu-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Please arrange a follow-up PR to add a test case similar to this
https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java#L1018-L1072

Use creatable NetworkInterface from here, so that IP address can also be deleted.

@v-hongli1 v-hongli1 merged commit 38cf774 into Azure:main Mar 27, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants