Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6E2111A5D for ; Sat, 11 May 2013 09:59:53 +0000 (UTC) Received: (qmail 8082 invoked by uid 500); 11 May 2013 09:59:41 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 7789 invoked by uid 500); 11 May 2013 09:59:36 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 4705 invoked by uid 99); 11 May 2013 09:59:29 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 May 2013 09:59:29 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6961888C0E3; Sat, 11 May 2013 09:59:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nitin@apache.org To: commits@cloudstack.apache.org Date: Sat, 11 May 2013 09:59:45 -0000 Message-Id: <3336c3d29c4345918ac2cc70ae530b0d@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [20/51] [partial] merge master http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/images/add-gslb.png ---------------------------------------------------------------------- diff --git a/docs/en-US/images/add-gslb.png b/docs/en-US/images/add-gslb.png new file mode 100644 index 0000000..827a913 Binary files /dev/null and b/docs/en-US/images/add-gslb.png differ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/images/eip-ns-basiczone.png ---------------------------------------------------------------------- diff --git a/docs/en-US/images/eip-ns-basiczone.png b/docs/en-US/images/eip-ns-basiczone.png new file mode 100644 index 0000000..bc88570 Binary files /dev/null and b/docs/en-US/images/eip-ns-basiczone.png differ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/images/gslb.png ---------------------------------------------------------------------- diff --git a/docs/en-US/images/gslb.png b/docs/en-US/images/gslb.png new file mode 100644 index 0000000..9f13580 Binary files /dev/null and b/docs/en-US/images/gslb.png differ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/increase-management-server-max-memory.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/increase-management-server-max-memory.xml b/docs/en-US/increase-management-server-max-memory.xml index 16d18e7..51c8724 100644 --- a/docs/en-US/increase-management-server-max-memory.xml +++ b/docs/en-US/increase-management-server-max-memory.xml @@ -28,7 +28,7 @@ Edit the Tomcat configuration file:/etc/cloud/management/tomcat6.conf Change the command-line parameter -XmxNNNm to a higher value of N.For example, if the current value is -Xmx128m, change it to -Xmx1024m or higher. - To put the new setting into effect, restart the Management Server.# service cloud-management restart + To put the new setting into effect, restart the Management Server.# service cloudstack-management restart For more information about memory issues, see "FAQ: Memory" at Tomcat Wiki. http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/install-usage-server.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/install-usage-server.xml b/docs/en-US/install-usage-server.xml index 9dde552..ffd748d 100644 --- a/docs/en-US/install-usage-server.xml +++ b/docs/en-US/install-usage-server.xml @@ -52,7 +52,7 @@ Once installed, start the Usage Server with the following command. -# service cloud-usage start +# service cloudstack-usage start http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/libcloud-examples.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/libcloud-examples.xml b/docs/en-US/libcloud-examples.xml new file mode 100644 index 0000000..d2db526 --- /dev/null +++ b/docs/en-US/libcloud-examples.xml @@ -0,0 +1,75 @@ + + +%BOOK_ENTITIES; +]> + + + +
+ Apache Libcloud + There are many tools available to interface with the &PRODUCT; API. Apache Libcloud is one of those. In this section + we provide a basic example of how to use Libcloud with &PRODUCT;. It assumes that you have access to a &PRODUCT; endpoint and that you have the API access key and secret key of a user. + To install Libcloud refer to the libcloud website. If you are familiar with Pypi simply do: + pip install apache-libcloud + You should see the following output: + +pip install apache-libcloud +Downloading/unpacking apache-libcloud + Downloading apache-libcloud-0.12.4.tar.bz2 (376kB): 376kB downloaded + Running setup.py egg_info for package apache-libcloud + +Installing collected packages: apache-libcloud + Running setup.py install for apache-libcloud + +Successfully installed apache-libcloud +Cleaning up... + + + You can then open a Python interactive shell, create an instance of a &PRODUCT; driver and call the available methods via the libcloud API. + + + >> from libcloud.compute.types import Provider +>>> from libcloud.compute.providers import get_driver +>>> Driver = get_driver(Provider.CLOUDSTACK) +>>> apikey='plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg' +>>> secretkey='VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ' +>>> host='http://localhost:8080' +>>> path='/client/api' +>>> conn=Driver(apikey,secretkey,secure='False',host='localhost:8080',path=path) +>>> conn=Driver(key=apikey,secret=secretkey,secure=False,host='localhost',port='8080',path=path) +>>> conn.list_images() +[] +>>> conn.list_sizes() +[, , ] +>>> images=conn.list_images() +>>> offerings=conn.list_sizes() +>>> node=conn.create_node(name='toto',image=images[0],size=offerings[0]) +>>> help(node) +>>> node.get_uuid() +'b1aa381ba1de7f2d5048e248848993d5a900984f' +>>> node.name +u'toto' +]]> + + + One of the interesting use cases of Libcloud is that you can use multiple Cloud Providers, such as AWS, Rackspace, OpenNebula, vCloud and so on. You can then create Driver instances to each of these clouds and create your own multi cloud application. + +
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/lxc-install.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/lxc-install.xml b/docs/en-US/lxc-install.xml index a80c18a..40f6a0a 100644 --- a/docs/en-US/lxc-install.xml +++ b/docs/en-US/lxc-install.xml @@ -74,9 +74,9 @@ To manage LXC instances on the host &PRODUCT; uses a Agent. This Agent communicates with the Management server and controls all the instances on the host. First we start by installing the agent: In RHEL or CentOS: - $ yum install cloud-agent + $ yum install cloudstack-agent In Ubuntu: - $ apt-get install cloud-agent + $ apt-get install cloudstack-agent Next step is to update the Agent configuration setttings. The settings are in /etc/cloudstack/agent/agent.properties http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/networks.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/networks.xml b/docs/en-US/networks.xml index c2090d2..8a7405a 100644 --- a/docs/en-US/networks.xml +++ b/docs/en-US/networks.xml @@ -36,7 +36,8 @@ - + http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/plugin-midonet-about.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/plugin-midonet-about.xml b/docs/en-US/plugin-midonet-about.xml new file mode 100644 index 0000000..dd9b3ad --- /dev/null +++ b/docs/en-US/plugin-midonet-about.xml @@ -0,0 +1,27 @@ + + +%BOOK_ENTITIES; + +%xinclude; +]> + + + The MidoNet Plugin + + + http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/plugin-midonet-features.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/plugin-midonet-features.xml b/docs/en-US/plugin-midonet-features.xml new file mode 100644 index 0000000..f242d63 --- /dev/null +++ b/docs/en-US/plugin-midonet-features.xml @@ -0,0 +1,57 @@ + + +%BOOK_ENTITIES; + +%xinclude; +]> + +
+ Features of the MidoNet Plugin + + + + In &PRODUCT; 4.2.0 only the KVM hypervisor is supported for use in combination with MidoNet. + + + + In &PRODUCT; release 4.2.0 this plugin supports several services in the Advanced Isolated network mode. + + + + When tenants create new isolated layer 3 networks, instead of spinning up extra Virtual Router VMs, the relevant L3 elements (routers etc) are created in the MidoNet virtual topology by making the appropriate calls to the MidoNet API. Instead of using VLANs, isolation is provided by MidoNet. + + + + Aside from the above service (Connectivity), several extra features are supported in the 4.2.0 release: + + + + DHCP + Firewall (ingress) + Source NAT + Static NAT + Port Forwarding + + + + The plugin has been tested with MidoNet version 12.12. (Caddo). + + + + +
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/plugin-midonet-introduction.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/plugin-midonet-introduction.xml b/docs/en-US/plugin-midonet-introduction.xml new file mode 100644 index 0000000..7793ecb --- /dev/null +++ b/docs/en-US/plugin-midonet-introduction.xml @@ -0,0 +1,26 @@ + + +%BOOK_ENTITIES; + +%xinclude; +]> + +
+ Introduction to the MidoNet Plugin + The MidoNet plugin allows &PRODUCT; to use the MidoNet virtualized networking solution as a provider for &PRODUCT; networks and services. For more information on MidoNet and how it works, see http://www.midokura.com/midonet/. +
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/plugin-midonet-preparations.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/plugin-midonet-preparations.xml b/docs/en-US/plugin-midonet-preparations.xml new file mode 100644 index 0000000..cf78774 --- /dev/null +++ b/docs/en-US/plugin-midonet-preparations.xml @@ -0,0 +1,90 @@ + + +%BOOK_ENTITIES; + +%xinclude; +]> + +
+ Prerequisites + + In order to use the MidoNet plugin, the compute hosts must be running the MidoNet Agent, and the MidoNet API server must be available. Please consult the MidoNet User Guide for more information. The following section describes the &PRODUCT; side setup. + + + + &PRODUCT; needs to have at least one physical network with the isolation method set to "MIDO". This network should be enabled for the Guest and Public traffic types. + + + + Next, we need to set the following &PRODUCT; settings under "Global Settings" in the UI: + +&PRODUCT; settings + + + + Setting Name + Description + Example + + + + + midonet.apiserver.address + Specify the address at which the Midonet API server can be contacted + http://192.168.1.144:8081/midolmanj-mgmt + + + midonet.providerrouter.id + Specifies the UUID of the Midonet provider router + d7c5e6a3-e2f4-426b-b728-b7ce6a0448e5 + + + +
+
+ + + + We also want MidoNet to take care of public traffic, so in componentContext.xml we need to replace this line: + + ]]> + + + With this: + + ]]> + + + +
+ + + + On the compute host, MidoNet takes advantage of per-traffic type VIF driver support in &PRODUCT; KVM. + + + In agent.properties, we set the following to make MidoNet take care of Guest and Public traffic: + +libvirt.vif.driver.Guest=com.cloud.network.resource.MidoNetVifDriver +libvirt.vif.driver.Public=com.cloud.network.resource.MidoNetVifDriver + + This is explained further in MidoNet User Guide. + + + +
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/plugin-midonet-provider.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/plugin-midonet-provider.xml b/docs/en-US/plugin-midonet-provider.xml new file mode 100644 index 0000000..904828c --- /dev/null +++ b/docs/en-US/plugin-midonet-provider.xml @@ -0,0 +1,39 @@ + + +%BOOK_ENTITIES; + +%xinclude; +]> + +
+ Enabling the MidoNet service provider via the API + + To enable via the API, use the following API calls: + addNetworkServiceProvider + + name = "MidoNet" + physicalnetworkid = <the uuid of the physical network> + + updateNetworkServiceProvider + + id = <the provider uuid returned by the previous call> + state = "Enabled" + + + +
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/plugin-midonet-revisions.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/plugin-midonet-revisions.xml b/docs/en-US/plugin-midonet-revisions.xml new file mode 100644 index 0000000..73def23 --- /dev/null +++ b/docs/en-US/plugin-midonet-revisions.xml @@ -0,0 +1,45 @@ + + +%BOOK_ENTITIES; +]> + + + + + Revision History + + + + 0-0 + Wed Mar 13 2013 + + Dave + Cahill + dcahill@midokura.com + + + + Documentation created for 4.2.0 version of the MidoNet Plugin + + + + + + http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/plugin-midonet-ui.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/plugin-midonet-ui.xml b/docs/en-US/plugin-midonet-ui.xml new file mode 100644 index 0000000..8ee9850 --- /dev/null +++ b/docs/en-US/plugin-midonet-ui.xml @@ -0,0 +1,65 @@ + + +%BOOK_ENTITIES; + +%xinclude; +]> + +
+ Enabling the MidoNet service provider via the UI + To allow &PRODUCT; to use the MidoNet Plugin the network service provider needs to be enabled on the physical network. + + + + The steps to enable via the UI are as follows: + + + In the left navbar, click Infrastructure + + + + In Zones, click View All + + + + Click the name of the Zone on which you are setting up MidoNet + + + + Click the Physical Network tab + + + + Click the Name of the Network on which you are setting up MidoNet + + + + Click Configure on the Network Service Providers box + + + + Click on the name MidoNet + + + + Click the Enable Provider button in the Network tab + + + + +
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/plugin-midonet-usage.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/plugin-midonet-usage.xml b/docs/en-US/plugin-midonet-usage.xml new file mode 100644 index 0000000..a314581 --- /dev/null +++ b/docs/en-US/plugin-midonet-usage.xml @@ -0,0 +1,29 @@ + + +%BOOK_ENTITIES; + +%xinclude; +]> + + + Using the MidoNet Plugin + + + + + http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/set-database-buffer-pool-size.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/set-database-buffer-pool-size.xml b/docs/en-US/set-database-buffer-pool-size.xml index 1c75031..8265ae5 100644 --- a/docs/en-US/set-database-buffer-pool-size.xml +++ b/docs/en-US/set-database-buffer-pool-size.xml @@ -26,7 +26,7 @@ Set Database Buffer Pool Size It is important to provide enough memory space for the MySQL database to cache data and indexes: - Edit the Tomcat configuration file:/etc/my.cnf + Edit the MySQL configuration file:/etc/my.cnf Insert the following line in the [mysqld] section, below the datadir line. Use a value that is appropriate for your situation. We recommend setting the buffer pool at 40% of RAM if MySQL is on the same server as the management server or 70% of RAM if MySQL has a dedicated server. The following example assumes a dedicated server with 1024M of RAM. innodb_buffer_pool_size=700M Restart the MySQL service.# service mysqld restart http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/set-global-project-resource-limits.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/set-global-project-resource-limits.xml b/docs/en-US/set-global-project-resource-limits.xml index d91942a..8ec1325 100644 --- a/docs/en-US/set-global-project-resource-limits.xml +++ b/docs/en-US/set-global-project-resource-limits.xml @@ -76,7 +76,7 @@
Restart the Management Server. - # service cloud-management restart + # service cloudstack-management restart
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/set-projects-creator-permissions.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/set-projects-creator-permissions.xml b/docs/en-US/set-projects-creator-permissions.xml index 9b272f6..dd9cfe9 100644 --- a/docs/en-US/set-projects-creator-permissions.xml +++ b/docs/en-US/set-projects-creator-permissions.xml @@ -56,7 +56,7 @@ Restart the Management Server. - # service cloud-management restart + # service cloudstack-management restart http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/set-up-invitations.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/set-up-invitations.xml b/docs/en-US/set-up-invitations.xml index c1303cf..180c041 100644 --- a/docs/en-US/set-up-invitations.xml +++ b/docs/en-US/set-up-invitations.xml @@ -89,7 +89,7 @@ Restart the Management Server: - service cloud-management restart + service cloudstack-management restart http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/signing-api-calls-python.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/signing-api-calls-python.xml b/docs/en-US/signing-api-calls-python.xml new file mode 100644 index 0000000..a2f897f --- /dev/null +++ b/docs/en-US/signing-api-calls-python.xml @@ -0,0 +1,101 @@ + + +%BOOK_ENTITIES; +]> + + + +
+ How to sign an API call with Python + To illustrate the procedure used to sign API calls we present a step by step interactive session + using Python. + + First import the required modules: + + + >> import urllib2 +>>> import urllib +>>> import hashlib +>>> import hmac +>>> import base64 + ]]> + + + Define the endpoint of the Cloud, the command that you want to execute and the keys of the user. + + >> baseurl='http://localhost:8080/client/api?' +>>> request={} +>>> request['command']='listUsers' +>>> request['response']='json' +>>> request['apikey']='plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg' +>>> secretkey='VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ' + ]]> + + Build the request string: + + >> request_str='&'.join(['='.join([k,urllib.quote_plus(request[k])]) for k in request.keys()]) +>>> request_str +'apikey=plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg&command=listUsers&response=json' + ]]> + + + Compute the signature with hmac, do a 64 bit encoding and a url encoding: + + >> sig_str='&'.join(['='.join([k.lower(),urllib.quote_plus(request[k].lower().replace('+','%20'))])for k in sorted(request.iterkeys())]) +>>> sig_str +'apikey=plgwjfzk4gys3momtvmjuvg-x-jlwlnfauj9gabbbf9edm-kaymmailqzzq1elzlyq_u38zcm0bewzgudp66mg&command=listusers&response=json' +>>> sig=hmac.new(secretkey,sig_str,hashlib.sha1) +>>> sig + +>>> sig=hmac.new(secretkey,sig_str,hashlib.sha1).digest() +>>> sig +'M:]\x0e\xaf\xfb\x8f\xf2y\xf1p\x91\x1e\x89\x8a\xa1\x05\xc4A\xdb' +>>> sig=base64.encodestring(hmac.new(secretkey,sig_str,hashlib.sha1).digest()) +>>> sig +'TTpdDq/7j/J58XCRHomKoQXEQds=\n' +>>> sig=base64.encodestring(hmac.new(secretkey,sig_str,hashlib.sha1).digest()).strip() +>>> sig +'TTpdDq/7j/J58XCRHomKoQXEQds=' +>>> sig=urllib.quote_plus(base64.encodestring(hmac.new(secretkey,sig_str,hashlib.sha1).digest()).strip()) + ]]> + + + Finally, build the entire string and do an http GET: + + >> req=baseurl+request_str+'&signature='+sig +>>> req +'http://localhost:8080/client/api?apikey=plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg&command=listUsers&response=json&signature=TTpdDq%2F7j%2FJ58XCRHomKoQXEQds%3D' +>>> res=urllib2.urlopen(req) +>>> res.read() +'{ "listusersresponse" : { "count":3 ,"user" : [ {"id":"7ed6d5da-93b2-4545-a502-23d20b48ef2a","username":"admin","firstname":"admin","lastname":"cloud","created":"2012-07-05T12:18:27-0700","state":"enabled","account":"admin","accounttype":1,"domainid":"8a111e58-e155-4482-93ce-84efff3c7c77","domain":"ROOT","apikey":"plgWJfZK4gyS3mOMTVmjUVg-X-jlWlnfaUJ9GAbBbf9EdM-kAYMmAiLqzzq1ElZLYq_u38zCm0bewzGUdP66mg","secretkey":"VDaACYb0LV9eNjTetIOElcVQkvJck_J_QljX_FcHRj87ZKiy0z0ty0ZsYBkoXkY9b7eq1EhwJaw7FF3akA3KBQ","accountid":"7548ac03-af1d-4c1c-9064-2f3e2c0eda0d"}, {"id":"1fea6418-5576-4989-a21e-4790787bbee3","username":"runseb","firstname":"foobar","lastname":"goa","email":"joe@smith.com","created":"2013-04-10T16:52:06-0700","state":"enabled","account":"admin","accounttype":1,"domainid":"8a111e58-e155-4482-93ce-84efff3c7c77","domain":"ROOT","apikey":"Xhsb3MewjJQaXXMszRcLvQI9_NPy_UcbDj1QXikkVbDC9MDSPwWdtZ1bUY1H7JBEYTtDDLY3yuchCeW778GkBA","secretkey":"gIsgmi8C5YwxMHjX5o51pSe0kqs6JnKriw0jJBLceY5b gnfzKjL4aM6ctJX-i1ddQIHJLbLJDK9MRzsKk6xZ_w","accountid":"7548ac03-af1d-4c1c-9064-2f3e2c0eda0d"}, {"id":"52f65396-183c-4473-883f-a37e7bb93967","username":"toto","firstname":"john","lastname":"smith","email":"john@smith.com","created":"2013-04-23T04:27:22-0700","state":"enabled","account":"admin","accounttype":1,"domainid":"8a111e58-e155-4482-93ce-84efff3c7c77","domain":"ROOT","apikey":"THaA6fFWS_OmvU8od201omxFC8yKNL_Hc5ZCS77LFCJsRzSx48JyZucbUul6XYbEg-ZyXMl_wuEpECzK-wKnow","secretkey":"O5ywpqJorAsEBKR_5jEvrtGHfWL1Y_j1E4Z_iCr8OKCYcsPIOdVcfzjJQ8YqK0a5EzSpoRrjOFiLsG0hQrYnDA","accountid":"7548ac03-af1d-4c1c-9064-2f3e2c0eda0d"} ] } }' + ]]> + + +
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/signing-api-requests.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/signing-api-requests.xml b/docs/en-US/signing-api-requests.xml index 581b32a..fc8773b 100644 --- a/docs/en-US/signing-api-requests.xml +++ b/docs/en-US/signing-api-requests.xml @@ -57,4 +57,7 @@ http://localhost:8080/client/api?command=deployVirtualMachine&serviceOfferingId=1&diskOfferingId=1&templateId=2&zoneId=4&apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXq-jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D + + + http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/stop-restart-management-server.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/stop-restart-management-server.xml b/docs/en-US/stop-restart-management-server.xml index 5c1bcec..74a687c 100644 --- a/docs/en-US/stop-restart-management-server.xml +++ b/docs/en-US/stop-restart-management-server.xml @@ -26,9 +26,9 @@ The root administrator will need to stop and restart the Management Server from time to time. For example, after changing a global configuration parameter, a restart is required. If you have multiple Management Server nodes, restart all of them to put the new parameter value into effect consistently throughout the cloud.. To stop the Management Server, issue the following command at the operating system prompt on the Management Server node: - # service cloud-management stop + # service cloudstack-management stop To start the Management Server: - # service cloud-management start + # service cloudstack-management start To stop the Management Server: - # service cloud-management stop + # service cloudstack-management stop http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/sys-offering-sysvm.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/sys-offering-sysvm.xml b/docs/en-US/sys-offering-sysvm.xml index cccf3e0..563dd6f 100644 --- a/docs/en-US/sys-offering-sysvm.xml +++ b/docs/en-US/sys-offering-sysvm.xml @@ -65,7 +65,7 @@ Restart &PRODUCT; Management Server. Restarting is required because the default offerings are loaded into the memory at startup. - service cloud-management restart + service cloudstack-management restart Destroy the existing CPVM or SSVM offerings and wait for them to be recreated. The new http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/tools.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/tools.xml b/docs/en-US/tools.xml index db6a510..8cddf28 100644 --- a/docs/en-US/tools.xml +++ b/docs/en-US/tools.xml @@ -27,4 +27,5 @@ + http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/en-US/zone-add.xml ---------------------------------------------------------------------- diff --git a/docs/en-US/zone-add.xml b/docs/en-US/zone-add.xml index 4f6606f..3ca5789 100644 --- a/docs/en-US/zone-add.xml +++ b/docs/en-US/zone-add.xml @@ -42,7 +42,7 @@ Restart the Management Server. - # service cloud-management restart + # service cloudstack-management restart Refresh the &PRODUCT; UI browser tab and log back in. http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/docs/publican-plugin-midonet.cfg ---------------------------------------------------------------------- diff --git a/docs/publican-plugin-midonet.cfg b/docs/publican-plugin-midonet.cfg new file mode 100644 index 0000000..6558d99 --- /dev/null +++ b/docs/publican-plugin-midonet.cfg @@ -0,0 +1,28 @@ +# Publican configuration file for CloudStack Complete Documentation Set +# Contains all technical docs except release notes +# Config::Simple 4.58 +# Tue May 29 00:57:27 2012 +# +# 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. + +xml_lang: en-US +type: Book +docname: MidoNet_Plugin_Guide +brand: cloudstack +chunk_first: 1 +chunk_section_depth: 1 +condition: install http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/engine/api/pom.xml ---------------------------------------------------------------------- diff --git a/engine/api/pom.xml b/engine/api/pom.xml index 1e8e8c3..1b8f26c 100644 --- a/engine/api/pom.xml +++ b/engine/api/pom.xml @@ -31,11 +31,6 @@ ${project.version} - org.apache.cloudstack - cloud-framework-api - ${project.version} - - org.apache.cxf cxf-bundle-jaxrs 2.7.0 @@ -55,6 +50,11 @@ cloud-framework-rest ${project.version} + + org.apache.cloudstack + cloud-framework-ipc + ${project.version} + install http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/engine/pom.xml ---------------------------------------------------------------------- diff --git a/engine/pom.xml b/engine/pom.xml index 1a3d896..169425a 100644 --- a/engine/pom.xml +++ b/engine/pom.xml @@ -29,8 +29,6 @@ install - src - test api http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/engine/schema/src/com/cloud/alert/AlertVO.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/alert/AlertVO.java b/engine/schema/src/com/cloud/alert/AlertVO.java new file mode 100755 index 0000000..3f014aa --- /dev/null +++ b/engine/schema/src/com/cloud/alert/AlertVO.java @@ -0,0 +1,183 @@ +// 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 com.cloud.alert; + +import java.util.Date; +import java.util.UUID; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import com.cloud.utils.db.GenericDao; + +@Entity +@Table(name="alert") +public class AlertVO implements Alert { + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="id") + private long id; + + @Column(name="type") + private short type; + + @Column(name="cluster_id") + private Long clusterId = null; + + @Column(name="pod_id") + private Long podId = null; + + @Column(name="data_center_id") + private long dataCenterId = 0; + + @Column(name="subject", length=999) + private String subject; + + @Column(name="sent_count") + private int sentCount = 0; + + @Column(name=GenericDao.CREATED_COLUMN) + private Date createdDate; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="last_sent", updatable=true, nullable=true) + private Date lastSent; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name="resolved", updatable=true, nullable=true) + private Date resolved; + + @Column(name="uuid") + private String uuid; + + @Column(name="archived") + private boolean archived; + + public AlertVO() { + this.uuid = UUID.randomUUID().toString(); + } + public AlertVO(Long id) { + this.id = id; + this.uuid = UUID.randomUUID().toString(); + } + + @Override + public long getId() { + return id; + } + @Override + public short getType() { + return type; + } + + public void setType(short type) { + this.type = type; + } + + @Override + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public Long getClusterId() { + return clusterId; + } + public void setClusterId(Long clusterId) { + this.clusterId = clusterId; + } + @Override + public Long getPodId() { + return podId; + } + + public void setPodId(Long podId) { + this.podId = podId; + } + + @Override + public long getDataCenterId() { + return dataCenterId; + } + + public void setDataCenterId(long dataCenterId) { + this.dataCenterId = dataCenterId; + } + + @Override + public int getSentCount() { + return sentCount; + } + + public void setSentCount(int sentCount) { + this.sentCount = sentCount; + } + + @Override + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + @Override + public Date getLastSent() { + return lastSent; + } + + public void setLastSent(Date lastSent) { + this.lastSent = lastSent; + } + + @Override + public Date getResolved() { + return resolved; + } + + public void setResolved(Date resolved) { + this.resolved = resolved; + } + + @Override + public String getUuid() { + return this.uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + @Override + public boolean getArchived() { + return archived; + } + + public void setArchived(Boolean archived) { + this.archived = archived; + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/engine/schema/src/com/cloud/alert/dao/AlertDao.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/alert/dao/AlertDao.java b/engine/schema/src/com/cloud/alert/dao/AlertDao.java new file mode 100755 index 0000000..fda814d --- /dev/null +++ b/engine/schema/src/com/cloud/alert/dao/AlertDao.java @@ -0,0 +1,33 @@ +// 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 com.cloud.alert.dao; + +import java.util.Date; +import java.util.List; + +import com.cloud.alert.AlertVO; +import com.cloud.utils.db.GenericDao; + +public interface AlertDao extends GenericDao { + AlertVO getLastAlert(short type, long dataCenterId, Long podId, Long clusterId); + // This is for backward compatibility + AlertVO getLastAlert(short type, long dataCenterId, Long podId); + + public boolean deleteAlert(List Ids, String type, Date olderThan, Long zoneId); + public boolean archiveAlert(List Ids, String type, Date olderThan, Long zoneId); + public List listOlderAlerts(Date oldTime); +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java b/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java new file mode 100755 index 0000000..4b9bc6a --- /dev/null +++ b/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java @@ -0,0 +1,156 @@ +// 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 com.cloud.alert.dao; + +import java.util.Date; +import java.util.List; + +import javax.ejb.Local; + +import org.springframework.stereotype.Component; + +import com.cloud.alert.AlertVO; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.SearchCriteria.Op; +import com.cloud.utils.db.Transaction; + +@Component +@Local(value = { AlertDao.class }) +public class AlertDaoImpl extends GenericDaoBase implements AlertDao { + + protected final SearchBuilder AlertSearchByIdsAndType; + + public AlertDaoImpl() { + AlertSearchByIdsAndType = createSearchBuilder(); + AlertSearchByIdsAndType.and("id", AlertSearchByIdsAndType.entity().getId(), Op.IN); + AlertSearchByIdsAndType.and("type", AlertSearchByIdsAndType.entity().getType(), Op.EQ); + AlertSearchByIdsAndType.and("createdDateL", AlertSearchByIdsAndType.entity().getCreatedDate(), Op.LT); + AlertSearchByIdsAndType.and("data_center_id", AlertSearchByIdsAndType.entity().getDataCenterId(), Op.EQ); + AlertSearchByIdsAndType.done(); + } + + @Override + public AlertVO getLastAlert(short type, long dataCenterId, Long podId, Long clusterId) { + Filter searchFilter = new Filter(AlertVO.class, "createdDate", Boolean.FALSE, Long.valueOf(0), Long.valueOf(1)); + SearchCriteria sc = createSearchCriteria(); + + sc.addAnd("type", SearchCriteria.Op.EQ, Short.valueOf(type)); + sc.addAnd("dataCenterId", SearchCriteria.Op.EQ, Long.valueOf(dataCenterId)); + if (podId != null) { + sc.addAnd("podId", SearchCriteria.Op.EQ, podId); + } + if (clusterId != null) { + sc.addAnd("clusterId", SearchCriteria.Op.EQ, clusterId); + } + + List alerts = listBy(sc, searchFilter); + if ((alerts != null) && !alerts.isEmpty()) { + return alerts.get(0); + } + return null; + } + + @Override + public AlertVO getLastAlert(short type, long dataCenterId, Long podId) { + Filter searchFilter = new Filter(AlertVO.class, "createdDate", Boolean.FALSE, Long.valueOf(0), Long.valueOf(1)); + SearchCriteria sc = createSearchCriteria(); + + sc.addAnd("type", SearchCriteria.Op.EQ, Short.valueOf(type)); + sc.addAnd("dataCenterId", SearchCriteria.Op.EQ, Long.valueOf(dataCenterId)); + if (podId != null) { + sc.addAnd("podId", SearchCriteria.Op.EQ, podId); + } + + List alerts = listBy(sc, searchFilter); + if ((alerts != null) && !alerts.isEmpty()) { + return alerts.get(0); + } + return null; + } + + @Override + public boolean archiveAlert(List Ids, String type, Date olderThan, Long zoneId) { + SearchCriteria sc = AlertSearchByIdsAndType.create(); + + if (Ids != null) { + sc.setParameters("id", Ids.toArray(new Object[Ids.size()])); + } + if(type != null) { + sc.setParameters("type", type); + } + if(zoneId != null) { + sc.setParameters("data_center_id", zoneId); + } + if(olderThan != null) { + sc.setParameters("createdDateL", olderThan); + } + boolean result = true;; + List alerts = listBy(sc); + if (Ids != null && alerts.size() < Ids.size()) { + result = false; + return result; + } + Transaction txn = Transaction.currentTxn(); + txn.start(); + for (AlertVO alert : alerts) { + alert = lockRow(alert.getId(), true); + alert.setArchived(true); + update(alert.getId(), alert); + txn.commit(); + } + txn.close(); + return result; + } + + @Override + public boolean deleteAlert(List ids, String type, Date olderThan, Long zoneId) { + SearchCriteria sc = AlertSearchByIdsAndType.create(); + + if (ids != null) { + sc.setParameters("id", ids.toArray(new Object[ids.size()])); + } + if(type != null) { + sc.setParameters("type", type); + } + if(zoneId != null) { + sc.setParameters("data_center_id", zoneId); + } + if(olderThan != null) { + sc.setParameters("createdDateL", olderThan); + } + boolean result = true; + List alerts = listBy(sc); + if (ids != null && alerts.size() < ids.size()) { + result = false; + return result; + } + remove(sc); + return result; + } + + @Override + public List listOlderAlerts(Date oldTime) { + if (oldTime == null) return null; + SearchCriteria sc = createSearchCriteria(); + sc.addAnd("createDate", SearchCriteria.Op.LT, oldTime); + return listIncludingRemovedBy(sc, null); + } + +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/engine/schema/src/com/cloud/capacity/CapacityVO.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/capacity/CapacityVO.java b/engine/schema/src/com/cloud/capacity/CapacityVO.java new file mode 100755 index 0000000..d34e9d3 --- /dev/null +++ b/engine/schema/src/com/cloud/capacity/CapacityVO.java @@ -0,0 +1,204 @@ +// 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 com.cloud.capacity; + +import javax.persistence.Transient; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import com.cloud.utils.db.GenericDao; +import org.apache.cloudstack.api.InternalIdentity; + +@Entity +@Table(name="op_host_capacity") +public class CapacityVO implements Capacity { + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="id") + private long id; + + @Column(name="host_id") + private Long hostOrPoolId; + + @Column(name="data_center_id") + private Long dataCenterId; + + @Column(name="pod_id") + private Long podId; + + @Column(name="cluster_id") + private Long clusterId; + + @Column(name="used_capacity") + private long usedCapacity; + + @Column(name="reserved_capacity") + private long reservedCapacity; + + @Column(name="total_capacity") + private long totalCapacity; + + @Column(name="capacity_type") + private short capacityType; + + @Column(name="capacity_state") + private CapacityState capacityState; + + @Column(name=GenericDao.CREATED_COLUMN) + protected Date created; + + @Column(name="update_time", updatable=true, nullable=true) + @Temporal(value=TemporalType.TIMESTAMP) + protected Date updateTime; + + @Transient + private Float usedPercentage; + + public CapacityVO() {} + + public CapacityVO(Long hostId, Long dataCenterId, Long podId, Long clusterId, long usedCapacity, long totalCapacity, short capacityType) { + this.hostOrPoolId = hostId; + this.dataCenterId = dataCenterId; + this.podId = podId; + this.clusterId = clusterId; + this.usedCapacity = usedCapacity; + this.totalCapacity = totalCapacity; + this.capacityType = capacityType; + this.updateTime = new Date(); + this.capacityState = CapacityState.Enabled; + } + + public CapacityVO(Long dataCenterId, Long podId, Long clusterId, short capacityType, float usedPercentage) { + this.dataCenterId = dataCenterId; + this.podId = podId; + this.clusterId = clusterId; + this.capacityType = capacityType; + this.usedPercentage = usedPercentage; + this.capacityState = CapacityState.Enabled; + } + + @Override + public long getId() { + return id; + } + + @Override + public Long getHostOrPoolId() { + return hostOrPoolId; + } + + public void setHostId(Long hostId) { + this.hostOrPoolId = hostId; + } + @Override + public Long getDataCenterId() { + return dataCenterId; + } + public void setDataCenterId(Long dataCenterId) { + this.dataCenterId = dataCenterId; + } + + @Override + public Long getPodId() { + return podId; + } + public void setPodId(long podId) { + this.podId = new Long(podId); + } + + @Override + public Long getClusterId() { + return clusterId; + } + public void setClusterId(long clusterId) { + this.clusterId = new Long(clusterId); + } + + @Override + public long getUsedCapacity() { + return usedCapacity; + } + public void setUsedCapacity(long usedCapacity) { + this.usedCapacity = usedCapacity; + this.setUpdateTime (new Date()); + } + @Override + public long getReservedCapacity() { + return reservedCapacity; + } + public void setReservedCapacity(long reservedCapacity) { + this.reservedCapacity = reservedCapacity; + this.setUpdateTime (new Date()); + } + @Override + public long getTotalCapacity() { + return totalCapacity; + } + public void setTotalCapacity(long totalCapacity) { + this.totalCapacity = totalCapacity; + this.setUpdateTime (new Date()); + } + @Override + public short getCapacityType() { + return capacityType; + } + public void setCapacityType(short capacityType) { + this.capacityType = capacityType; + } + + public CapacityState getCapacityState() { + return capacityState; + } + + public void setCapacityState(CapacityState capacityState) { + this.capacityState = capacityState; + } + + public Date getCreated() { + return created; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + @Override + public Float getUsedPercentage() { + return usedPercentage; + } + + public void setUsedPercentage(float usedPercentage) { + this.usedPercentage = usedPercentage; + } + + @Override + public String getUuid() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java b/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java new file mode 100755 index 0000000..04466f4 --- /dev/null +++ b/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java @@ -0,0 +1,45 @@ +// 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 com.cloud.capacity.dao; + +import java.util.List; +import java.util.Map; + +import com.cloud.capacity.CapacityVO; +import com.cloud.capacity.dao.CapacityDaoImpl.SummedCapacity; +import com.cloud.utils.Pair; +import com.cloud.utils.db.GenericDao; + +public interface CapacityDao extends GenericDao { + CapacityVO findByHostIdType(Long hostId, short capacityType); + List listClustersInZoneOrPodByHostCapacities(long id, int requiredCpu, long requiredRam, short capacityTypeForOrdering, boolean isZone); + List listHostsWithEnoughCapacity(int requiredCpu, long requiredRam, Long clusterId, String hostType); + boolean removeBy(Short capacityType, Long zoneId, Long podId, Long clusterId, Long hostId); + List findByClusterPodZone(Long zoneId, Long podId, Long clusterId); + List findNonSharedStorageForClusterPodZone(Long zoneId,Long podId, Long clusterId); + Pair, Map> orderClustersByAggregateCapacity(long id, short capacityType, boolean isZone); + List findCapacityBy(Integer capacityType, Long zoneId, Long podId, Long clusterId); + + List listPodsByHostCapacities(long zoneId, int requiredCpu, long requiredRam, short capacityType); + Pair, Map> orderPodsByAggregateCapacity(long zoneId, short capacityType); + List findCapacityBy(Integer capacityType, Long zoneId, + Long podId, Long clusterId, String resourceState); + List listCapacitiesGroupedByLevelAndType(Integer capacityType, Long zoneId, Long podId, Long clusterId, int level, Long limit); + void updateCapacityState(Long dcId, Long podId, Long clusterId, + Long hostId, String capacityState); + List listClustersCrossingThreshold(short capacityType, Long zoneId, String ConfigName, long computeRequested); +}