-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// 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.api.response; | ||
|
||
import com.cloud.serializer.Param; | ||
import com.google.gson.annotations.SerializedName; | ||
import org.apache.cloudstack.api.ApiConstants; | ||
import org.apache.cloudstack.api.BaseResponse; | ||
import org.apache.cloudstack.management.ManagementServerHost.State; | ||
|
||
import java.util.Date; | ||
|
||
public class PeerManagementServerNodeResponse extends BaseResponse { | ||
|
||
@SerializedName(ApiConstants.STATE) | ||
@Param(description = "the state of the management server peer") | ||
private State state; | ||
|
||
@SerializedName(ApiConstants.LAST_UPDATED) | ||
@Param(description = "the last updated time of the management server peer state") | ||
private Date lastUpdated; | ||
|
||
@SerializedName(ApiConstants.PEER_ID) | ||
@Param(description = "the ID of the peer management server") | ||
private String peerId; | ||
|
||
@SerializedName(ApiConstants.PEER_NAME) | ||
@Param(description = "the name of the peer management server") | ||
private String peerName; | ||
|
||
@SerializedName(ApiConstants.PEER_MSID) | ||
@Param(description = "the management ID of the peer management server") | ||
private String peerMsId; | ||
|
||
@SerializedName(ApiConstants.PEER_RUNID) | ||
@Param(description = "the run ID of the peer management server") | ||
private String peerRunId; | ||
|
||
@SerializedName(ApiConstants.PEER_STATE) | ||
@Param(description = "the state of the peer management server") | ||
private String peerState; | ||
|
||
@SerializedName(ApiConstants.PEER_SERVICE_IP) | ||
@Param(description = "the IP Address for the peer Management Server") | ||
private String peerServiceIp; | ||
|
||
@SerializedName(ApiConstants.PEER_SERVICE_PORT) | ||
@Param(description = "the service port for the peer Management Server") | ||
private String peerServicePort; | ||
|
||
public void setState(State state) { | ||
this.state = state; | ||
} | ||
Check warning on line 67 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L65-L67
|
||
|
||
public void setLastUpdated(Date lastUpdated) { | ||
this.lastUpdated = lastUpdated; | ||
} | ||
Check warning on line 71 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L69-L71
|
||
|
||
public void setPeerId(String peerId) { | ||
this.peerId = peerId; | ||
} | ||
Check warning on line 75 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L73-L75
|
||
|
||
public void setPeerName(String peerName) { | ||
this.peerName = peerName; | ||
} | ||
Check warning on line 79 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L77-L79
|
||
|
||
public void setPeerMsId(String peerMsId) { | ||
this.peerMsId = peerMsId; | ||
} | ||
Check warning on line 83 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L81-L83
|
||
|
||
public void setPeerRunId(String peerRunId) { | ||
this.peerRunId = peerRunId; | ||
} | ||
Check warning on line 87 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L85-L87
|
||
|
||
public void setPeerState(String peerState) { | ||
this.peerState = peerState; | ||
} | ||
Check warning on line 91 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L89-L91
|
||
|
||
public void setPeerServiceIp(String peerServiceIp) { | ||
this.peerServiceIp = peerServiceIp; | ||
} | ||
Check warning on line 95 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L93-L95
|
||
|
||
public void setPeerServicePort(String peerServicePort) { | ||
this.peerServicePort = peerServicePort; | ||
} | ||
Check warning on line 99 in api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java Codecov / codecov/patchapi/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java#L97-L99
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- 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. | ||
|
||
DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`; | ||
|
||
CREATE PROCEDURE `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY` ( | ||
IN in_table_name VARCHAR(200) | ||
, IN in_key_name VARCHAR(200) | ||
, IN in_foreign_key VARCHAR(200) | ||
, IN in_references VARCHAR(1000) | ||
) | ||
BEGIN | ||
|
||
DECLARE CONTINUE HANDLER FOR 1061 BEGIN END; SET @ddl = CONCAT_WS(' ', 'ALTER TABLE ', in_table_name, ' ADD CONSTRAINT ', in_key_name, ' FOREIGN KEY ', in_foreign_key, ' REFERENCES ', in_references, ' ON DELETE CASCADE'); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
-- 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. | ||
|
||
|
||
DROP VIEW IF EXISTS `cloud`.`mshost_peer_view`; | ||
|
||
CREATE VIEW `cloud`.`mshost_peer_view` AS | ||
SELECT | ||
`mshost_peer`.`id` AS `id`, | ||
`mshost_peer`.`peer_state` AS `peer_state`, | ||
`mshost_peer`.`last_update` AS `last_update`, | ||
`owner_mshost`.`id` AS `owner_mshost_id`, | ||
`owner_mshost`.`msid` AS `owner_mshost_msid`, | ||
`owner_mshost`.`runid` AS `owner_mshost_runid`, | ||
`owner_mshost`.`name` AS `owner_mshost_name`, | ||
`owner_mshost`.`uuid` AS `owner_mshost_uuid`, | ||
`owner_mshost`.`state` AS `owner_mshost_state`, | ||
`owner_mshost`.`service_ip` AS `owner_mshost_service_ip`, | ||
`owner_mshost`.`service_port` AS `owner_mshost_service_port`, | ||
`peer_mshost`.`id` AS `peer_mshost_id`, | ||
`peer_mshost`.`msid` AS `peer_mshost_msid`, | ||
`peer_mshost`.`runid` AS `peer_mshost_runid`, | ||
`peer_mshost`.`name` AS `peer_mshost_name`, | ||
`peer_mshost`.`uuid` AS `peer_mshost_uuid`, | ||
`peer_mshost`.`state` AS `peer_mshost_state`, | ||
`peer_mshost`.`service_ip` AS `peer_mshost_service_ip`, | ||
`peer_mshost`.`service_port` AS `peer_mshost_service_port` | ||
FROM `cloud`.`mshost_peer` | ||
LEFT JOIN `cloud`.`mshost` AS owner_mshost on `mshost_peer`.`owner_mshost` = `owner_mshost`.`id` | ||
LEFT JOIN `cloud`.`mshost` AS peer_mshost on `mshost_peer`.`peer_mshost` = `peer_mshost`.`id`; |