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

Can't reorder gateway firewall rule using apiClient (nsx-t) #86

Open
jayyyyyyy opened this issue Oct 18, 2019 · 1 comment
Open

Can't reorder gateway firewall rule using apiClient (nsx-t) #86

jayyyyyyy opened this issue Oct 18, 2019 · 1 comment
Assignees

Comments

@jayyyyyyy
Copy link

jayyyyyyy commented Oct 18, 2019

  • [O] I am using the latest SDK version 2.4.1
  • [O] This API is compatible with my vCenter version (You can get this info from the API documentation )
  • [O] I have searched existing issues

Description

Hi! I am developing automation tool which create gateway firewall rule.

I don't know if I can post a question here but I have no place to post.

I developed using java sdk (2.4.1) But I could not use revise method.

I filled out parameter but it doesn't work.

Environment

  • SDK version: 2.4.1
  • Java version: 1.8
  • vSphere version:

Steps or code snippet to reproduce

ApiClient apiClient = getApiClient(firewallInfo);
Rules ruleService = apiClient.createStub(Rules.class);
String ruleId = fwRuleInfo.getAssignedRuleId();
String location = fwRuleInfo.getOrderLocation();
Rule rule = ruleService.get(DEFAULT_DOMAIN_ID, DEFAULT_POLICY_ID, ruleId);
// bottom
ruleService.revise(DEFAULT_DOMAIN_ID, DEFAULT_POLICY_ID, ruleId, rule, null, RulesTypes.REVISE_OPERATION_BOTTOM);

// after
ruleService.revise(DEFAULT_DOMAIN_ID, DEFAULT_POLICY_ID, ruleId, rule, location, RulesTypes.REVISE_OPERATION_AFTER);

// before
ruleService.revise(DEFAULT_DOMAIN_ID, DEFAULT_POLICY_ID, ruleId, rule, location, RulesTypes.REVISE_OPERATION_BEFORE);

Actual behavior

ErrorMessage is below.
com.vmware.vapi.std.errors.InvalidRequest: InvalidRequest (com.vmware.vapi.std.errors.invalid_request) => {
messages = [],
data = struct => {error_message=Method is not allowed, error_code=282, module_name=common-services},
errorType = INVALID_REQUEST
}
at com.vmware.vapi.std.errors.InvalidRequest._newInstance2(InvalidRequest.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.createStructBinding(JavaClassStructConverter.java:220)
at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.fromValue(JavaClassStructConverter.java:78)
at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.fromValue(JavaClassStructConverter.java:32)
at com.vmware.vapi.internal.bindings.TypeConverterImpl$ValueToJavaVisitor.visit(TypeConverterImpl.java:346)
at com.vmware.vapi.bindings.type.ErrorType.accept(ErrorType.java:31)
at com.vmware.vapi.internal.bindings.TypeConverterImpl.convertToJava(TypeConverterImpl.java:688)
at com.vmware.vapi.internal.bindings.Stub.convert(Stub.java:417)
at com.vmware.vapi.internal.bindings.Stub.convertError(Stub.java:434)
at com.vmware.vapi.internal.bindings.Stub.access$300(Stub.java:57)
at com.vmware.vapi.internal.bindings.Stub$2.setResult(Stub.java:239)
at com.vmware.vapi.internal.bindings.Stub$2.setResult(Stub.java:230)
at com.vmware.vapi.internal.protocol.client.rest.DefaultRequestExecutorFactory$DefaultHttpResponseHandler.onResult(DefaultRequestExecutorFactory.java:86)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor$AuthzRefreshingHttpResponseHandler.onResult(AuthzRefreshingRequestExecutorFactory.java:160)
at com.vmware.vapi.internal.protocol.client.rpc.http.ApacheClientRestTransport.execute(ApacheClientRestTransport.java:79)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.authorizeAndExecute(AuthzRefreshingRequestExecutorFactory.java:112)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.access$100(AuthzRefreshingRequestExecutorFactory.java:58)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor$1.onComplete(AuthzRefreshingRequestExecutorFactory.java:98)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.refreshContext(AuthzRefreshingRequestExecutorFactory.java:188)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.refreshContextIfNeeded(AuthzRefreshingRequestExecutorFactory.java:171)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.execute(AuthzRefreshingRequestExecutorFactory.java:105)
at com.vmware.vapi.internal.protocol.client.rest.RestClientApiProvider.invoke(RestClientApiProvider.java:70)
at com.vmware.vapi.internal.bindings.Stub.invoke(Stub.java:225)
at com.vmware.vapi.internal.bindings.Stub.invoke(Stub.java:206)
at com.vmware.vapi.internal.bindings.Stub.invokeMethodAsync(Stub.java:170)
at com.vmware.vapi.internal.bindings.Stub.invokeMethod(Stub.java:138)
at com.vmware.nsx_policy.infra.domains.gateway_policies.RulesStub.revise(RulesStub.java:226)
at com.vmware.nsx_policy.infra.domains.gateway_policies.RulesStub.revise(RulesStub.java:213)

Expected behavior

reorder firewall rule.

other methods(list, get, update, delete) are fine. only revise method doesn't work.

@jobingeo
Copy link
Contributor

jobingeo commented Oct 18, 2019

@ggoodvmw Can You please look into this?
#86

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

3 participants