<?xml version="1.0"?>
<slaTemplate>
	<label>Sample Data and Job Package 1</label>
	<description>Basic data and job service package.  Limited to 1 CPU, 1000 CPU.s/day and 20MB disc space.</description>

	<!-- The billing period is mandatory and defines how often the aggregated usage will be charged to the user's account -->
	<billingPeriod>
		<years>0</years>
		<months>0</months>
		<days>1</days>
		<hours>0</hours>
		<minutes>0</minutes>
		<seconds>0</seconds>
	</billingPeriod>

	<!-- The signing fee is mandatory and defines how much the user will be charged upfront on agreeing the SLA -->
	<!-- The subscription fee is mandatory and defines how much the user will be charged at the end of each billing period -->
	<signingFee>10.00</signingFee>
	<subscriptionFee>10.00</subscriptionFee>
	<!-- The currency applies to all the prices listed in the SLA template -->
	<currency>EUR</currency>

	<!-- The startTime and endTime define the validity period of the SLA template -->
	<startTime>
		<year>2000</year>
		<month>1</month>
		<dayOfMonth>1</dayOfMonth>
	</startTime>
	<endTime>
		<year>2010</year>
		<month>1</month>
		<dayOfMonth>1</dayOfMonth>
	</endTime>

	<!-- permittedServices is a list of which services the client may use with this SLA.  If the list is empty then all services are permitted -->
	<permittedServices>
		<!-- Edit, and uncomment the permittedService below if you want to restrict the client to certain services -->
		<!--
		<permittedService>
			<url>https://example.com:443/gria-basic-app-services/services/JobService</url>
		</permittedService>
        -->
	</permittedServices>

	<!-- constraints is a mandatory list of constraint elements.  It may be empty.  -->
	<constraints>
		<!-- A constraint can eith be of type INSTANTANEOUS or CUMULATIVE -->
		<!-- This constraint limits the user to using at most 1 CPU at any time -->
		<constraint type='INSTANTANEOUS'>
			<!-- A metric is something that one of the functional services measures and reports.  It is uniquely defined by its URI -->
			<metric type='RESOURCE'>
				<uri>http://www.gria.org/sla/metric/resource/cpu</uri>
				<description>
					<description>CPU</description>
				</description>
				<units type='DECIMAL'>
					<instantaneous>CPU</instantaneous>
				</units>
			</metric>
			<!-- bound may be LT, LE or EQ meaning 'less than', 'less than or equal to' and 'equal to' respectively -->
			<bound>LE</bound>
			<!-- private may be false or true.  If it is true then the user will not see the constraint (but it will still be enforced) -->
			<private>false</private>
			<!-- limit is the limit of the constraint, in this case we are permitting <= 1.0 CPU -->
			<limit>1.0</limit>
			<!-- contention defines how many users will be contending for this portion of resource.  It is often not applicable.  -->
			<contention>1.0</contention>
			<!-- A constraint may be repeating, in which case a duration is also defined (see below) -->
			<repeating>false</repeating>
		</constraint>

		<!-- This constraint limits the user to using at most 1000 CPU.seconds each day -->
		<constraint type='CUMULATIVE'>
			<metric type='RESOURCE'>
				<uri>http://www.gria.org/sla/metric/resource/cpu</uri>
				<description>
					<description>CPU</description>
				</description>
				<units type='DECIMAL'>
					<instantaneous>CPU</instantaneous>
				</units>
			</metric>
			<bound>LE</bound>
			<private>false</private>
			<limit>1000.0</limit>
			<contention>1.0</contention>
			<!-- This constraint is repeating.  It constrains the usage over a period of time defined by the duration -->
			<repeating>true</repeating>
			<!-- The duration of a repeating constraint would normally be the same as the billing period -->
			<duration>
				<years>0</years>
				<months>0</months>
				<days>1</days>
				<hours>0</hours>
				<minutes>0</minutes>
				<seconds>0</seconds>
			</duration>
		</constraint>

		<!-- This constraint limits the user to using at most 20MiB of disc space at any one time -->
		<constraint type='INSTANTANEOUS'>
			<metric type='RESOURCE'>
				<uri>http://www.gria.org/sla/metric/resource/disc</uri>
				<description>
					<description>disc space</description>
					<instantaneous>amount of disc space</instantaneous>
				</description>
				<units type='BINARY'>
					<instantaneous>B</instantaneous>
				</units>
			</metric>
			<bound>LE</bound>
			<private>false</private>
			<limit>20971520</limit>  <!-- 20MiB -->
			<contention>1.0</contention>
			<repeating>false</repeating>
		</constraint>
	</constraints>

	<!-- pricingTerms is a mandatory list of pricingTerm elements.  It may be empty.  -->
	<pricingTerms>
		<!-- A pricing term may be either of type CUMULATIVE or INSTANTANEOUS_INCREASE -->
		<!-- This pricing terms specifies that the first 300 CPU seconds are free.  
		If the term did not exist they would still be free, but this way the free usage appears in the statement -->
		<pricingTerm type='CUMULATIVE'>
			<description>free seconds</description>
			<!-- the lower and upperBound elements define the range of usage that the pricing term applies to -->
			<lowerBound>0</lowerBound>
			<upperBound>300</upperBound>
			<!-- the price/currency is multiplied by the usage within the lower/upper bound range -->
			<price>0</price>
			<!-- Each pricing term applies to a metric that is reported on by a functional service -->
			<metric type='RESOURCE'>
				<uri>http://www.gria.org/sla/metric/resource/cpu</uri>
				<description>
					<description>CPU</description>
				</description>
				<units type='DECIMAL'>
					<instantaneous>CPU</instantaneous>
				</units>
			</metric>
		</pricingTerm>

		<!-- This pricing terms specifies that CPU usage above 300 CPU seconds is charged at 0.01 EUR per second -->
		<pricingTerm type='CUMULATIVE'>
			<description>standard rate</description>
			<lowerBound>300</lowerBound>
			<!-- An upperBound of -1 means +infinity -->
			<upperBound>-1</upperBound>
			<price>0.01</price>
			<metric type='RESOURCE'>
				<uri>http://www.gria.org/sla/metric/resource/cpu</uri>
				<description>
					<description>CPU</description>
				</description>
				<units type='DECIMAL'>
					<instantaneous>CPU</instantaneous>
				</units>
			</metric>
		</pricingTerm>

		<!-- Every time a job starts, the instantaneous measurement of
		the number of jobs goes up by one (and then down by one when
		it finishes).  A pricingTerm of type INSTANTANEOUS_INCREASE
		calculates the increase of the instantaneous measurement over
		the billing period, ignoring decreases.  The instantaneous
		increase is then multiplied by the price accordingly. -->

		<!-- This pricing term specifies that there is a charge of 0.10 EUR every time a job is created -->
		<pricingTerm type='INSTANTANEOUS_INCREASE'>
			<description>creation charge</description>
			<lowerBound>0</lowerBound>
			<upperBound>-1</upperBound>
			<price>0.10</price>
			<metric type='ACTIVITY'>
				<uri>http://www.gria.org/sla/metric/activity/job</uri>
				<description>
					<description>job</description>
				</description>
				<units type='DECIMAL'>
					<instantaneous>job</instantaneous>
				</units>
			</metric>
		</pricingTerm>

		<!-- This pricing term specifies that there is a charge of 0.10 EUR every time a data-stager is created -->
		<pricingTerm type='INSTANTANEOUS_INCREASE'>
			<description>creation charge</description>
			<lowerBound>0</lowerBound>
			<upperBound>-1</upperBound>
			<price>0.10</price>
			<metric type='ACTIVITY'>
				<uri>http://www.gria.org/sla/metric/activity/data-stager</uri>
				<description>
					<description>data stager</description>
				</description>
				<units type='DECIMAL'>
					<instantaneous>data-stager</instantaneous>
				</units>
			</metric>
		</pricingTerm>

	</pricingTerms>
</slaTemplate>

