diff options
Diffstat (limited to 'ncomp-openstack-model/src/main/xcore')
-rw-r--r-- | ncomp-openstack-model/src/main/xcore/ceilometer.xcore | 130 | ||||
-rw-r--r-- | ncomp-openstack-model/src/main/xcore/compute.xcore | 250 | ||||
-rw-r--r-- | ncomp-openstack-model/src/main/xcore/core.xcore | 70 | ||||
-rw-r--r-- | ncomp-openstack-model/src/main/xcore/location.xcore | 149 | ||||
-rw-r--r-- | ncomp-openstack-model/src/main/xcore/neutron.xcore | 214 | ||||
-rw-r--r-- | ncomp-openstack-model/src/main/xcore/openstack.xcore | 40 |
6 files changed, 853 insertions, 0 deletions
diff --git a/ncomp-openstack-model/src/main/xcore/ceilometer.xcore b/ncomp-openstack-model/src/main/xcore/ceilometer.xcore new file mode 100644 index 0000000..cc5d9aa --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore/ceilometer.xcore @@ -0,0 +1,130 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed 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. + * ============LICENSE_END============================================ + */ + +@GenModel(modelDirectory="/ncomp-openstack-model/src/main/xcore-gen") + +package org.openecomp.ncomp.openstack.ceilometer + +import org.openecomp.ncomp.openstack.core.OpenStackRequest +import org.openecomp.ncomp.core.NamedEntity +import org.openecomp.ncomp.openstack.compute.Link +import org.openecomp.ncomp.openstack.compute.Metadata + +annotation "http://openecomp.org/sirius/openstack" as openstack + +abstract class CeilometerService { + op CeilometerAlarm createAlarm(CreateAlarmRequest request) + op void deleteAlarm(String projectName, String name) + op CeilometerSample[] createAlarm(SampleRequest request) + String[] ceilometerAvailableCapabilites + String[] ceilometerUnavailableCapabilites +} + +abstract class CeilometerProject { + contains CeilometerAlarm[] alarms + contains CeilometerResource[] resources + contains CeilometerMeter[] meters +} + +abstract class CeilometerAlarm extends NamedEntity { + String ^id + String user_id + Date timestamp + Boolean enabled + String state + Date state_timestamp + String description + String[] alarm_actions + String[] ok_actions + String[] insufficient_data_actions + Boolean repeat_actions + String[] time_constraints +} + +class CeilometerThresholdAlarm extends CeilometerAlarm { + contains CeilometerThresholdAlarmRule threshold_rule + +} + +class CeilometerThresholdAlarmRule { + String meter_name + Long evaluation_periods + Long period + String statistic + double threshold + String[] query + String comparison_operator + Boolean exclude_outliers +} + + +class CeilometerResource { + String ^id + String user_id + String project_id + Date first_sample_timestamp + Date last_sample_timestamp + contains Link[] links + contains Metadata metadata +} +class CeilometerMeter {} + +class CeilometerQuery { + contains CeilometerFilter[] filter + contains CeilometerOrderedBy[] orderby + Long limit +} + +class CeilometerFilter { + String operation + String value + String field + contains CeilometerFilter[] filters +} + +class CeilometerOrderedBy { + String field + String direction +} + +abstract class CeilometerRequest extends OpenStackRequest { + +} + +class CreateAlarmRequest extends CeilometerRequest { +} + +class SampleRequest extends CeilometerRequest { + contains CeilometerQuery query +} + +class CeilometerSample { + String counter_name + String user_id + String resource_id + Date timestamp + Date recorded_at + String message_id + String source + String counter_unit + double counter_volume + String project_id +} diff --git a/ncomp-openstack-model/src/main/xcore/compute.xcore b/ncomp-openstack-model/src/main/xcore/compute.xcore new file mode 100644 index 0000000..fea7a78 --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore/compute.xcore @@ -0,0 +1,250 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed 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. + * ============LICENSE_END============================================ + */ + +@GenModel(modelDirectory="/ncomp-openstack-model/src/main/xcore-gen") + +package org.openecomp.ncomp.openstack.compute + +import org.openecomp.ncomp.core.NamedEntity +import org.openecomp.ncomp.openstack.core.OpenStackRequest +import org.openecomp.ncomp.openstack.core.VirtualMachineType +import org.openecomp.ncomp.core.User +import org.openecomp.ncomp.openstack.core.OpenstackRequestDelete + +abstract class ComputeService { + op void createServer(OpenstackRequestNewServer request) + op void deleteServer(String projectName, String name) + op void createKeyPair(OpenstackRequestKeyPair request) + op void delete(OpenstackRequestDelete request) + op void createFlavor(OpenstackRequestFlavor request) + op void createSecurityGroup(OpenstackRequestSecurityGroup request) + op void serverAction(OpenstackRequestServerAction request) + op void deployVmType(String vmTypeName, String projectName) + op void undeployVmType(String vmTypeName, String projectName) + op void deployUser(User user, String projectName) + op void undeployUser(User user, String projectName) +} + +class OpenstackRequestNewServer extends OpenStackRequest { + String name + String hypervisor + String user + String[] networks + String[] ports + String user_data + String floatingIp + contains VirtualMachineType vmType +} + + +class OpenstackRequestKeyPair extends OpenStackRequest { + contains User user +} + +class OpenstackRequestFlavor extends OpenStackRequest { + contains VirtualMachineType vmType +} + +class OpenstackRequestSecurityGroup extends OpenStackRequest { + contains VirtualMachineType vmType +} + +class OpenstackRequestServerAction extends OpenStackRequest { + String name + String action +} + +class OpenstackRequestPoll extends OpenStackRequest { +} + + +class Server { + String ^id + String tenant_id + String user_id + String name + String updated + String created + String hostId + String accessIPv4 + String accessIPv6 + String status + String config_drive + String key_name + int progress + String OS_DCF_diskConfig + int OS_EXT_STS_power_state + String OS_EXT_STS_vm_state + String OS_EXT_STS_task_state + String OS_EXT_SRV_ATTR_host + String OS_EXT_SRV_ATTR_instance_name + String OS_EXT_SRV_ATTR_hypervisor_hostname + String OS_SRV_USG_launched_at + String OS_SRV_USG_terminated_at + contains Reference image + contains Reference flavor + contains Addresses[] addresses + contains SecurityGroup[] security_groups + contains Metadata[] metadata + contains Link[] links + contains Fault fault + + + + + + + +} + +class Image { + String ^id + String name + String updated + String created + String tenant_id + String user_id + String status + Long progress + Long minDisk + Long minRam + Long OS_EXT_IMG_SIZE_size + contains Reference server + contains Link[] links + contains Metadata[] metadata +} + +class Flavor { + String ^id + String name + int ram + int disk + int vcpus + String swap + double rxtx_factor + int OS_FLV_EXT_DATA_ephemeral + boolean OS_FLV_DISABLED_disabled + boolean os_flavor_access_is_public + contains Link[] links +} + +class Addresses { + String name + contains Address[] ips +} + +class Address { + int version + String addr + String OS_EXT_IPS_MAC_mac_addr + String OS_EXT_IPS_type +} + +class Link { + String rel + String href + String ^type +} + +class Metadata { + String key + String value +} + +class Fault { + String message + String created + int code +} + +class Personality { + String path + String contents +} + +class Reference { + String ^id + contains Link[] links +} + +class Volume extends NamedEntity { + String status + String display_name + contains VolumeAttachment[] attachments + String availability_zone + String created_at + String volume_type + contains Metadata[] metadata + String ^id + int size + String snapshot_id + String display_description +} + + +class VolumeAttachment { + String device + String server_id + String ^id + String volume_id +} + +class FloatingIp { + String instance_id + String ip + String fixed_ip + String ^id + String pool +} + +class SecurityGroup extends NamedEntity { + contains SecurityRule[] rules + String tenant_id + String ^id + String description +} + +class SecurityRule { + Integer from_port + contains SecurityGroup group + String ip_protocol + Integer to_port + String parent_group_id + contains SecurityRange ip_range + String ^id +} + +class SecurityRange { + String cidr +} + +class KeyPair { + String public_key + String name + String fingerprint +} + + + + + + + diff --git a/ncomp-openstack-model/src/main/xcore/core.xcore b/ncomp-openstack-model/src/main/xcore/core.xcore new file mode 100644 index 0000000..eae2811 --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore/core.xcore @@ -0,0 +1,70 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed 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. + * ============LICENSE_END============================================ + */ + +@GenModel(modelDirectory="/ncomp-openstack-model/src/main/xcore-gen") + +package org.openecomp.ncomp.openstack.core + + +import org.openecomp.ncomp.core.NamedEntity +import org.openecomp.ncomp.core.DeploymentStatus + + +abstract class OpenStackRequest { + String projectName +} + + +class OpenstackRequestDelete extends OpenStackRequest { + String objectType + String objectName +} + +class OpenstackRequestPoll extends OpenStackRequest { +} + + +class VirtualMachineType extends NamedEntity { + String description + int numberOfCores + int memorySizeMB + int rootDiskSizeGB + int diskSizeGB + int volumeSizeGB + String imageName + String flavorName + boolean needPublicIp + DeploymentStatus deploymentStatus + contains SecurityRule[] incomingSecurityRules + contains SecurityRule[] outboundSecurityRules +} + +class SecurityRule extends NamedEntity { + Integer portRangeStart + Integer portRangeEnd + String prefix + SecurityRuleProtocol ipProtocol +} + +enum SecurityRuleProtocol { none = 1000, tcp = 17, udp = 6, imcp = 0 } + + + diff --git a/ncomp-openstack-model/src/main/xcore/location.xcore b/ncomp-openstack-model/src/main/xcore/location.xcore new file mode 100644 index 0000000..3c84ac9 --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore/location.xcore @@ -0,0 +1,149 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed 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. + * ============LICENSE_END============================================ + */ + +@GenModel(modelDirectory="/ncomp-openstack-model/src/main/xcore-gen") + +package org.openecomp.ncomp.openstack.location + +import org.openecomp.ncomp.core.NamedEntity +import org.openecomp.ncomp.openstack.compute.Flavor +import org.openecomp.ncomp.openstack.compute.FloatingIp +import org.openecomp.ncomp.openstack.compute.Image +import org.openecomp.ncomp.openstack.compute.KeyPair +import org.openecomp.ncomp.openstack.compute.SecurityGroup +import org.openecomp.ncomp.openstack.compute.Server +import org.openecomp.ncomp.openstack.compute.Volume +import org.openecomp.ncomp.openstack.neutron.CreateNetworkRequest +import org.openecomp.ncomp.openstack.neutron.Network +import org.openecomp.ncomp.openstack.neutron.NeutronSecurityGroup +import org.openecomp.ncomp.openstack.neutron.Port +import org.openecomp.ncomp.openstack.neutron.Router +import org.openecomp.ncomp.openstack.neutron.Subnet +import org.openecomp.ncomp.openstack.neutron.NeutronService +import org.openecomp.ncomp.openstack.compute.ComputeService +import org.openecomp.ncomp.openstack.neutron.NeutronFloatingIp +import org.openecomp.ncomp.openstack.ceilometer.CeilometerService +import org.openecomp.ncomp.openstack.ceilometer.CeilometerProject + +annotation 'http://openecomp.org/sirius/persistence' as persistence + + +class OpenStackLocation extends NamedEntity, NeutronService, ComputeService, CeilometerService { + OpenStackVersion version + boolean remoteLocation = "false" + String remoteLocationName + boolean allowCreateFlavor + String keystoneUrl + String bypassIp + int flavorId = "20000" + boolean supportsSecurityGroups = "true" + boolean supportsFloatingIps = "true" + contains unordered OpenStackProject[] projects + contains unordered OpenStackUser[] users + contains unordered Image[] images // + contains unordered Flavor[] flavors // + contains unordered Hypervisor[] hypervisors + op void poll() + op void mergeLocation(OpenStackLocation loc) +} + +enum OpenStackVersion { + Folsom, + Grizzly, + Havana, + Icehouse, + Juno, + Kilo, + Liberty, + Mitaka +} + +class OpenStackProject extends NamedEntity, CeilometerProject { + String ID + String adminUser + String tenantId + String region + String privateNetwork + String publicNetwork + String apiKey // Rackspace + contains unordered Server[] servers // + refers unordered OpenStackUser[] users + refers OpenStackUser controllerUser + op void updateNovaState() + contains unordered Volume[] volumes + contains unordered FloatingIp[] ips + contains unordered SecurityGroup[] groups + contains unordered KeyPair[] keypairs + contains unordered Network[] networks + contains unordered Subnet[] subnets + contains unordered Router[] routers + contains unordered Port[] ports + contains unordered NeutronSecurityGroup[] security_groups + contains unordered NeutronFloatingIp[] floatingips + op Network createNetwork(CreateNetworkRequest r) +} + +class OpenStackUser extends NamedEntity { + @persistence(propertyFile="bsa.properties") + transient String password +} + +class HypervisorService { + String host // lab3-bsa-03-bay03 + int ^id // 14 +} + +class HypervisorCpuTopology { + int cores // 8 + int threads // 2 + int sockets // 1 +} + + +class HypervisorCpuInfo { + String vendor // Intel + String model // SandyBridge + String arch // x86_64 + String[] features // ["pdpe1gb","osxsave","dca","pdcm","xtpr","tm2","est","smx","vmx","ds_cpl","monitor","dtes64","pbe","tm","ht","ss","acpi","ds","vme"] + contains HypervisorCpuTopology topology // {"cores":8,"threads":2,"sockets":1} +} + + +class Hypervisor extends NamedEntity { + contains HypervisorService service // {"host":"lab3-bsa-03-bay03","id":14} + String host_ip + int vcpus_used // 4 + String hypervisor_type // QEMU + int local_gb_used // 60 + String hypervisor_hostname // + int memory_mb_used // 20992 + int memory_mb // 257922 + int current_workload // 0 + int vcpus // 64 + contains HypervisorCpuInfo cpu_info // {"vendor": "Intel", "model": "SandyBridge", "arch": "x86_64", "features": ["pdpe1gb", "osxsave", "dca", "pdcm", "xtpr", "tm2", "est", "smx", "vmx", "ds_cpl", "monitor", "dtes64", "pbe", "tm", "ht", "ss", "acpi", "ds", "vme"], "topology": {"cores": 8, "threads": 2, "sockets": 1}} + int running_vms // 2 + int free_disk_gb // 1007 + int hypervisor_version // 1002000 + int disk_available_least // 977 + int local_gb // 1067 + int free_ram_mb // 236930 + int ^id // 2 +} diff --git a/ncomp-openstack-model/src/main/xcore/neutron.xcore b/ncomp-openstack-model/src/main/xcore/neutron.xcore new file mode 100644 index 0000000..c5f8fde --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore/neutron.xcore @@ -0,0 +1,214 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed 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. + * ============LICENSE_END============================================ + */ + +@GenModel(modelDirectory="/ncomp-openstack-model/src/main/xcore-gen") + +package org.openecomp.ncomp.openstack.neutron + +import org.openecomp.ncomp.openstack.core.OpenStackRequest + +annotation "http://openecomp.org/sirius/openstack" as openstack + +abstract class NeutronService { + op Network createNetwork(CreateNetworkRequest request) + op Subnet createSubnet(CreateSubnetRequest request) + op Port createPort(CreatePortRequest request) + op Router createRouter(CreateRouterRequest request) + op void deleteNetwork(String projectName, String name) + op void deleteSubnet(String projectName, String name) + op void deletePort(String projectName, String name) + op void deleteRouter(String projectName, String name) + op void associateFloatingIp(String projectName, String ipId, String portId) +} + + +abstract class NeutronObject {} + +class Network extends NeutronObject { + String ^id + String name + Boolean admin_state_up + String provider_network_type + String provider_physical_network + Integer provider_segmentation_id + Boolean router_external + Boolean shared + String status + String[] subnets + String tenant_id +} + +class Subnet extends NeutronObject { + String ^id + String name + String status + Boolean admin_state_up + String cidr + contains AllocationPool[] allocation_pools + String[] dns_nameservers + Boolean enable_dhcp + String gateway_ip + String[] host_routes + Integer ip_version + String network_id + String tenant_id +} + +class AllocationPool { + String start + String end +} + +class Router extends NeutronObject { + String ^id + String name + String status + Boolean admin_state_up + contains ExternalGateway external_gateway_info + String tenant_id +} + +class Port extends NeutronObject { + String ^id + String name + String status + Boolean admin_state_up + contains ExternalGateway external_gateway_info + String tenant_id + String[] allowed_address_pairs + String binding_host_id + contains BindingProfile binding_profile + contains BindingVifDetail binding_vif_details + String binding_vif_type + String binding_vnic_type + String device_id + String device_owner + String[] extra_dhcp_opts + contains FixedIp[] fixed_ips + String mac_address + String network_id + String[] security_groups +} + +class NeutronSecurityGroup extends NeutronObject { + String ^id + String name + String description + contains NeutronSecurityRule[] security_group_rules + String tenant_id +} + +class NeutronSecurityRule extends NeutronObject { + String ^id + String direction + String ethertype + Integer port_range_min + Integer port_range_max + String protocol + String remote_group_id + String remote_ip_prefix + String security_group_id + String tenant_id +} + +class NeutronFloatingIp extends NeutronObject { + String ^id + String name + String status + String floating_network_id + String router_id + String fixed_ip_address + String floating_ip_address + String tenant_id + String port_id +} + + +class BindingProfile { +} + +class BindingVifDetail { + Boolean ovs_hybrid_plug + Boolean port_filter +} + +class FixedIp { + String ip_address + String subnet_id +} + +class ExternalGateway { + Boolean enable_snat + String network_id +} + +abstract class NeutronRequest extends OpenStackRequest { +} + +class CreateNetworkRequest extends NeutronRequest { + String name + @openstack(name="provider:network_type") + String providerNetworkType + @openstack(name="provider:physical_network") + String providerPhysicalNetwork + @openstack(name="provider:segmentation_id") + int providerSegmentationId + Boolean admin_state_up + Boolean shared +} + +class CreateSubnetRequest extends NeutronRequest { + String name + String[1] network_id + int ip_version + String cidr + contains AllocationPool[] allocation_pools + String[] dns_nameservers + Boolean enable_dhcp + String gateway_ip +} + +class CreateRouterRequest extends NeutronRequest { + String name + Boolean admin_state_up + Boolean shared + String externalNetwork + String[] ports + String[] subnets +} + +class CreatePortRequest extends NeutronRequest { + String name + @openstack(name="binding:vnic_type") + String bindingVnicType + String status + Boolean admin_state_up + @openstack(removeEmptyList="true") + contains FixedIp[] fixed_ips + String mac_address + String[1] network_id + //String[] security_groups +} + + + + + diff --git a/ncomp-openstack-model/src/main/xcore/openstack.xcore b/ncomp-openstack-model/src/main/xcore/openstack.xcore new file mode 100644 index 0000000..8c0fa9a --- /dev/null +++ b/ncomp-openstack-model/src/main/xcore/openstack.xcore @@ -0,0 +1,40 @@ + +/*- + * ============LICENSE_START========================================== + * OPENECOMP - DCAE + * =================================================================== + * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed 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. + * ============LICENSE_END============================================ + */ + +@GenModel(modelDirectory="/ncomp-openstack-model/src/main/xcore-gen") + + +package org.openecomp.ncomp.openstack + +import org.openecomp.ncomp.core.User +import org.openecomp.ncomp.openstack.core.VirtualMachineType +import org.openecomp.ncomp.openstack.location.OpenStackLocation +import org.openecomp.ncomp.core.RemoteContext + +class OpenStackController { + contains OpenStackLocation[] locations + contains VirtualMachineType[] vmTypes + contains User[] users + op void uploadOpenstackConfiguration(RemoteContext cx, OpenStackLocation loc) +} + + + |