update response and add license

This commit is contained in:
Pearl Dsilva 2023-08-24 12:19:10 -04:00
parent bb9b6441a2
commit 937b34b200
6 changed files with 50 additions and 1 deletions

View File

@ -810,7 +810,9 @@ public class ApiConstants {
public static final String NICIRA_NVP_L2_GATEWAYSERVICE_UUID = "l2gatewayserviceuuid";
public static final String NSX_LOGICAL_SWITCH = "nsxlogicalswitch";
public static final String NSX_LOGICAL_SWITCH_PORT = "nsxlogicalswitchport";
public static final String NSX_PROVIDER_UUID = "nsxprovideruuid";
public static final String NSX_PROVIDER_HOSTNAME = "nsxproviderhostname";
public static final String NSX_PROVIDER_PORT = "nsxproviderport";
public static final String NSX_CONTROLLER_ID = "nsxcontrollerid";
public static final String S3_ACCESS_KEY = "accesskey";

View File

@ -1,3 +1,19 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.agent.api;
import com.cloud.agent.api.StartupCommand;

View File

@ -33,7 +33,7 @@ import javax.inject.Inject;
import static org.apache.cloudstack.api.command.DeleteNsxControllerCmd.APINAME;
@APICommand(name = APINAME, description = "Add NSX Controller to CloudStack",
@APICommand(name = APINAME, description = "delete NSX Controller to CloudStack",
responseObject = NsxControllerResponse.class, requestHasSensitiveInfo = false,
responseHasSensitiveInfo = false, since = "4.19.0.0")
public class DeleteNsxControllerCmd extends BaseCmd {

View File

@ -25,6 +25,9 @@ import org.apache.cloudstack.api.EntityReference;
@EntityReference(value = {NsxProvider.class})
public class NsxControllerResponse extends BaseResponse {
@SerializedName(ApiConstants.NSX_PROVIDER_UUID)
@Param(description = "NSX controller ID")
private String uuid;
@SerializedName(ApiConstants.NAME)
@Param(description = "NSX controller name")
private String name;
@ -57,6 +60,14 @@ public class NsxControllerResponse extends BaseResponse {
@Param(description = "The name of the edge cluster. An edge cluster is a logical grouping of edge nodes in NSX")
private String edgeCluster;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getName() {
return name;
}

View File

@ -1,3 +1,19 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.service;
import com.cloud.agent.AgentManager;

View File

@ -34,6 +34,7 @@ import com.cloud.resource.ResourceManager;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.db.TransactionCallback;
import com.cloud.utils.exception.CloudRuntimeException;
import org.apache.cloudstack.api.command.DeleteNsxControllerCmd;
import org.apache.cloudstack.api.command.ListNsxControllersCmd;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.command.AddNsxControllerCmd;
@ -126,12 +127,14 @@ public class NsxProviderServiceImpl implements NsxProviderService {
}
NsxControllerResponse response = new NsxControllerResponse();
response.setName(nsxProvider.getProviderName());
response.setUuid(nsxProvider.getUuid());
response.setHostname(nsxProvider.getHostname());
response.setPort(nsxProvider.getPort());
response.setZoneId(nsxProvider.getZoneId());
response.setZoneName(zone.getName());
response.setTier0Gateway(nsxProvider.getTier0Gateway());
response.setTier0Gateway(nsxProvider.getEdgeCluster());
response.setObjectName("nsxController");
return response;
}
@ -184,6 +187,7 @@ public class NsxProviderServiceImpl implements NsxProviderService {
List<Class<?>> cmdList = new ArrayList<Class<?>>();
cmdList.add(AddNsxControllerCmd.class);
cmdList.add(ListNsxControllersCmd.class);
cmdList.add(DeleteNsxControllerCmd.class);
return cmdList;
}
}