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

Enabling force parameter in delete request of Java client #1518

Closed
lgiommi opened this issue Jan 25, 2024 · 2 comments
Closed

Enabling force parameter in delete request of Java client #1518

lgiommi opened this issue Jan 25, 2024 · 2 comments

Comments

@lgiommi
Copy link

lgiommi commented Jan 25, 2024

Hi,
I am using the Java package im-java-api version 0.4.15 in indigo-dc orchestrator. I see from the code of IM that you have the force parameter (as reported in your guide) to force the deletion of an infrastructure. Unfortunately in the Java client for the REST API of the IM it is not supported. Indeed the function destroyInfrastructureAsync in the InfrastructureManager class is defined as

public void destroyInfrastructureAsync(String infId) throws ImClientException {
    RestParameter asyncParameter = createCallParameters(REST_PARAMETER_NAME_ASYNC, true);
    getImClient().delete(PATH_INFRASTRUCTURES + PATH_SEPARATOR + infId,
        String.class, asyncParameter);
  }

and the only argument it takes is the infrastructure id. I tried to concatenate it with "?force=true" but it seems it doesn't work.

@micafer
Copy link
Member

micafer commented Jan 29, 2024

Did you tried something like this?:

    RestParameter asyncParameter = createCallParameters(REST_PARAMETER_NAME_ASYNC, true);
    RestParameter forceParameter = createCallParameters("force", true);
    getImClient().delete(PATH_INFRASTRUCTURES + PATH_SEPARATOR + infId,
        String.class, asyncParameter, forceParameter);

@lgiommi
Copy link
Author

lgiommi commented Jan 30, 2024

Thanks Miguel for the suggestion. I opened a pull request to add this code in the indigo-dc/im-java-api repo.

@micafer micafer closed this as completed Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants