omf_sfa 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. data/.gitignore +24 -0
  2. data/Gemfile +6 -0
  3. data/README.md +211 -0
  4. data/Rakefile +23 -0
  5. data/bin/parse_rspec.rb +167 -0
  6. data/etc/omf-sfa/omf-sfa-am.yaml +12 -0
  7. data/examples/exogeni5nodemanifest.rspec +105 -0
  8. data/examples/instageni5nodemanifest.rspec +150 -0
  9. data/lib/omf-sfa/am/am-rest/REST_API.md +301 -0
  10. data/lib/omf-sfa/am/am-rest/account_handler.rb +145 -0
  11. data/lib/omf-sfa/am/am-rest/am_rest_server.rb +255 -0
  12. data/lib/omf-sfa/am/am-rest/api_template.html +48 -0
  13. data/lib/omf-sfa/am/am-rest/config.ru +110 -0
  14. data/lib/omf-sfa/am/am-rest/resource_handler.rb +178 -0
  15. data/lib/omf-sfa/am/am-rest/rest_handler.rb +573 -0
  16. data/lib/omf-sfa/am/am-rest/session_authenticator.rb +130 -0
  17. data/lib/omf-sfa/am/am-rpc/abstract_rpc_service.rb +60 -0
  18. data/lib/omf-sfa/am/am-rpc/am_authorizer.rb +161 -0
  19. data/lib/omf-sfa/am/am-rpc/am_rpc_api.rb +450 -0
  20. data/lib/omf-sfa/am/am-rpc/am_rpc_service.rb +402 -0
  21. data/lib/omf-sfa/am/am_liaison.rb +93 -0
  22. data/lib/omf-sfa/am/am_manager.rb +859 -0
  23. data/lib/omf-sfa/am/am_runner.rb +108 -0
  24. data/lib/omf-sfa/am/am_scheduler.rb +146 -0
  25. data/lib/omf-sfa/am/am_server.rb +194 -0
  26. data/lib/omf-sfa/am/config.ru +122 -0
  27. data/lib/omf-sfa/am/credential.rb +145 -0
  28. data/lib/omf-sfa/am/default_authorizer.rb +44 -0
  29. data/lib/omf-sfa/am/privilege_credential.rb +76 -0
  30. data/lib/omf-sfa/am/signature.rb +37 -0
  31. data/lib/omf-sfa/am/user_credential.rb +56 -0
  32. data/lib/omf-sfa/am.rb +7 -0
  33. data/lib/omf-sfa/model/abstract_prop_description.rb +87 -0
  34. data/lib/omf-sfa/model/model_class_description.rb +145 -0
  35. data/lib/omf-sfa/model/model_data_prop_description.rb +28 -0
  36. data/lib/omf-sfa/model/model_obj_prop_description.rb +49 -0
  37. data/lib/omf-sfa/model/ontology.rb +169 -0
  38. data/lib/omf-sfa/resource/README.md +24 -0
  39. data/lib/omf-sfa/resource/channel.rb +49 -0
  40. data/lib/omf-sfa/resource/comp_group.rb +41 -0
  41. data/lib/omf-sfa/resource/component_lease.rb +10 -0
  42. data/lib/omf-sfa/resource/constants.rb +24 -0
  43. data/lib/omf-sfa/resource/group_component.rb +35 -0
  44. data/lib/omf-sfa/resource/group_membership.rb +17 -0
  45. data/lib/omf-sfa/resource/gurn.rb +187 -0
  46. data/lib/omf-sfa/resource/interface.rb +78 -0
  47. data/lib/omf-sfa/resource/ip.rb +48 -0
  48. data/lib/omf-sfa/resource/link.rb +29 -0
  49. data/lib/omf-sfa/resource/node.rb +75 -0
  50. data/lib/omf-sfa/resource/oaccount.rb +94 -0
  51. data/lib/omf-sfa/resource/ocomponent.rb +134 -0
  52. data/lib/omf-sfa/resource/ogroup.rb +106 -0
  53. data/lib/omf-sfa/resource/olease.rb +61 -0
  54. data/lib/omf-sfa/resource/oproperty.rb +178 -0
  55. data/lib/omf-sfa/resource/oreference.rb +15 -0
  56. data/lib/omf-sfa/resource/oresource.rb +491 -0
  57. data/lib/omf-sfa/resource/project.rb +28 -0
  58. data/lib/omf-sfa/resource/project_membership.rb +13 -0
  59. data/lib/omf-sfa/resource/sfa_base.rb +544 -0
  60. data/lib/omf-sfa/resource/user.rb +25 -0
  61. data/lib/omf-sfa/resource.rb +20 -0
  62. data/lib/omf-sfa/util/create_sample_testbed.rb +68 -0
  63. data/lib/omf-sfa/util/load_from_sfa_xml.rb +65 -0
  64. data/lib/omf-sfa/version.rb +4 -0
  65. data/lib/omf_sfa.rb +5 -0
  66. data/omf_sfa.gemspec +46 -0
  67. data/owl/README +3 -0
  68. data/owl/ben-6509.rdf +1377 -0
  69. data/owl/ben-dell.rdf +586 -0
  70. data/owl/ben-dtn.rdf +1698 -0
  71. data/owl/ben.rdf +1335 -0
  72. data/owl/collections.owl +309 -0
  73. data/owl/compute.owl +1486 -0
  74. data/owl/domain.owl +444 -0
  75. data/owl/dtn.owl +1165 -0
  76. data/owl/ec2.owl +385 -0
  77. data/owl/ethernet.owl +466 -0
  78. data/owl/eucalyptus.owl +431 -0
  79. data/owl/id-mp-Request1.rdf +247 -0
  80. data/owl/itu-grid.owl +147 -0
  81. data/owl/kansei.owl +511 -0
  82. data/owl/layer.owl +645 -0
  83. data/owl/location.owl +117 -0
  84. data/owl/mass.rdf +608 -0
  85. data/owl/nlr.rdf +901 -0
  86. data/owl/orca.owl +181 -0
  87. data/owl/planetlab.owl +124 -0
  88. data/owl/protogeni.owl +467 -0
  89. data/owl/request-6509-2.rdf +150 -0
  90. data/owl/request-6509-3.rdf +158 -0
  91. data/owl/request-6509.rdf +199 -0
  92. data/owl/request.owl +222 -0
  93. data/owl/storage.owl +511 -0
  94. data/owl/topology.owl +608 -0
  95. data/schema/rspec-v3/ad-common.xsd +269 -0
  96. data/schema/rspec-v3/ad-reservation.rnc +12 -0
  97. data/schema/rspec-v3/ad-reservation.rng +28 -0
  98. data/schema/rspec-v3/ad-reservation.xsd +13 -0
  99. data/schema/rspec-v3/ad.rnc +151 -0
  100. data/schema/rspec-v3/ad.xsd +77 -0
  101. data/schema/rspec-v3/any-extension-schema.xsd +38 -0
  102. data/schema/rspec-v3/any-extension.rnc +30 -0
  103. data/schema/rspec-v3/common.rnc +185 -0
  104. data/schema/rspec-v3/manifest-common.xsd +244 -0
  105. data/schema/rspec-v3/manifest-request.xsd +95 -0
  106. data/schema/rspec-v3/manifest.rnc +62 -0
  107. data/schema/rspec-v3/manifest.xsd +34 -0
  108. data/schema/rspec-v3/request-common.xsd +219 -0
  109. data/schema/rspec-v3/request-reservation.rnc +12 -0
  110. data/schema/rspec-v3/request-reservation.xsd +13 -0
  111. data/schema/rspec-v3/request.rnc +118 -0
  112. data/schema/rspec-v3/request.xsd +94 -0
  113. data/share/assets/css/default.css +147 -0
  114. data/share/assets/css/rest_api.css +0 -0
  115. data/share/assets/network.html +28 -0
  116. data/share/assets/network.js +82 -0
  117. data/spec/am/am-rest/common.rb +29 -0
  118. data/spec/am/am-rest/resource_group_handler_XspecX.rb +97 -0
  119. data/spec/am/am-rest/resource_handler_spec.rb +204 -0
  120. data/spec/am/am-rpc/sfa_methods_spec.rb +150 -0
  121. data/spec/am/am_manager_spec.rb +307 -0
  122. data/spec/am/am_scheduler_spec.rb +57 -0
  123. data/spec/am/common.rb +24 -0
  124. data/spec/resource/common.rb +31 -0
  125. data/spec/resource/node_spec.rb +171 -0
  126. data/spec/resource/oaccount_spec.rb +92 -0
  127. data/spec/resource/ocomponent_spec.rb +225 -0
  128. data/spec/resource/ogroup_spec.rb +93 -0
  129. data/spec/resource/oresource_spec.rb +208 -0
  130. data/spec/resource_and_leases_spec.rb +377 -0
  131. data/test/OLD_FILES/assertion1.xml +117 -0
  132. data/test/OLD_FILES/greeter_spec.rb +15 -0
  133. data/test/OLD_FILES/mongo_test.rb +45 -0
  134. data/test/OLD_FILES/req-sfa-2.xml +6 -0
  135. data/test/OLD_FILES/req-sfa-g.xml +8 -0
  136. data/test/OLD_FILES/req-sfa-g2.xml +10 -0
  137. data/test/OLD_FILES/req-sfa-g3.xml +14 -0
  138. data/test/OLD_FILES/req-sfa.xml +6 -0
  139. data/test/OLD_FILES/req1.xml +22 -0
  140. data/test/OLD_FILES/req1b.xml +15 -0
  141. data/test/OLD_FILES/rspec-test.xml +1867 -0
  142. data/test/OLD_FILES/test.rb +67 -0
  143. data/test/OLD_FILES/test2.rb +32 -0
  144. data/test/am/am_manager_rspec_tests.rb +378 -0
  145. data/test/am/am_manager_tests.rb +518 -0
  146. data/test/am/am_scheduler_tests.rb +173 -0
  147. data/test/resource/olease_test.rb +74 -0
  148. data/test/sfa_requests/request.xml +5 -0
  149. data/test/sfa_requests/request1.xml +5 -0
  150. data/test/sfa_requests/request2.xml +5 -0
  151. data/test/sfa_requests/request3.xml +5 -0
  152. metadata +601 -0
@@ -0,0 +1,60 @@
1
+
2
+
3
+ require 'xmlrpc/parser'
4
+ require 'rack/rpc'
5
+
6
+ require 'omf_base/lobject'
7
+
8
+ require 'omf-sfa/am'
9
+
10
+ module OMF::SFA::AM
11
+ module RPC; end
12
+ end
13
+
14
+ module OMF::SFA::AM::RPC
15
+
16
+ class AbstractService < Rack::RPC::Server
17
+
18
+ include OMF::Base::Loggable
19
+
20
+ # This defines a method to declare the service methods and all their
21
+ # parameters.
22
+ #
23
+ def self.implement(api)
24
+ @@mappings ||= {}
25
+ api.api_description.each do |m|
26
+ wrapper_name = "_wrapper_#{m.method_name}".to_sym
27
+ self.send(:define_method, wrapper_name) do |*args|
28
+ begin
29
+ self.class.hooks[:before].each do |command|
30
+ command.call(self) if command.callable?(m.method_name)
31
+ end
32
+
33
+ out = self.send(m.method_name, *args)
34
+
35
+ self.class.hooks[:after].each do |command|
36
+ command.call(self) if command.callable?(m.method_name)
37
+ end
38
+ out
39
+ rescue Exception => ex
40
+ error ex
41
+ debug "Backtrace\n\t#{ex.backtrace.join("\n\t")}"
42
+ raise ex
43
+ end
44
+ end
45
+ #puts "API: map #{m.rpc_name} to #{wrapper_name}"
46
+ @@mappings[m.rpc_name.to_s] = wrapper_name
47
+ end
48
+ end
49
+
50
+ def self.rpc(mappings = nil)
51
+ raise "Unexpected argument '#{mappings}' for rpc" if mappings
52
+ @@mappings
53
+ end
54
+ end # AbstractService
55
+
56
+
57
+ end # module
58
+
59
+
60
+
@@ -0,0 +1,161 @@
1
+ require 'omf_base/lobject'
2
+ require 'omf-sfa/am/default_authorizer'
3
+ require 'omf-sfa/am/user_credential'
4
+ require 'omf-sfa/am/privilege_credential'
5
+
6
+ module OMF::SFA::AM::RPC
7
+
8
+ include OMF::Base
9
+
10
+ # This class implements the decision logic for determining
11
+ # access of a user in a specific context to specific functionality
12
+ # in the AM
13
+ #
14
+ class AMAuthorizer < OMF::SFA::AM::DefaultAuthorizer
15
+
16
+ # @!attribute [r] account
17
+ # @return [OAccount] The account associated with this instance
18
+ attr_reader :account
19
+
20
+ # @!attribute [r] project
21
+ # @return [OProject] The project associated with this account
22
+ attr_reader :project
23
+
24
+ # @!attribute [r] user
25
+ # @return [User] The user associated with this membership
26
+ attr_reader :user
27
+
28
+
29
+ # @!attribute [r] certificate
30
+ # @return [Hash] The certificate associated with this caller
31
+ # attr_reader :certificate
32
+
33
+
34
+ # Create an instance from the information
35
+ # provided by the rack's 'req' object.
36
+ #
37
+ # @param [Rack::Request] Request provided by the Rack API
38
+ # @param [AbstractAmManager#get_account] AM Manager for retrieving AM context
39
+ #
40
+ def self.create_for_sfa_request(account_urn, credentials, request, am_manager)
41
+
42
+ begin
43
+ raise "Missing peer cert" unless cert_s = request.env['rack.peer_cert']
44
+ peer = OMF::SFA::AM::UserCredential.unmarshall(cert_s)
45
+ end
46
+ debug "Requester: #{peer.subject} :: #{peer.user_urn}"
47
+
48
+ raise OMF::SFA::AM::InsufficientPrivilegesException.new "Credentials are missing." if credentials.nil?
49
+
50
+ unless peer.valid_at?
51
+ OMF::SFA::AM::InsufficientPrivilegesException.new "The certificate has expired or not valid yet. Check the dates."
52
+ end
53
+ user = am_manager.find_or_create_user({:uuid => peer.user_uuid, :urn => peer.user_urn})
54
+
55
+ creds = credentials.map do |cs|
56
+ cs = OMF::SFA::AM::PrivilegeCredential.unmarshall(cs)
57
+ cs.tap do |c|
58
+ unless c.valid_at?
59
+ OMF::SFA::AM::InsufficientPrivilegesException.new "The credentials have expired or not valid yet. Check the dates."
60
+ end
61
+ end
62
+ end
63
+
64
+
65
+ self.new(account_urn, peer, creds, am_manager)
66
+ end
67
+
68
+
69
+ ##### ACCOUNT
70
+
71
+ def can_renew_account?(account, expiration_time)
72
+ debug "Check permission 'can_renew_account?' (#{account == @account}, #{@permissions[:can_renew_account?]}, #{@user_cred.valid_at?(expiration_time)})"
73
+ unless account == @account &&
74
+ @permissions[:can_renew_account?] &&
75
+ @user_cred.valid_at?(expiration_time) # not sure if this is the right check
76
+ raise OMF::SFA::AM::InsufficientPrivilegesException.new("Can't renew account after the expiration of the credentials")
77
+ end
78
+ end
79
+
80
+ ##### RESOURCE
81
+
82
+ def can_release_resource?(resource)
83
+ unless resource.account == @account && @permissions[:can_release_resource?]
84
+ raise OMF::SFA::AM::InsufficientPrivilegesException.new
85
+ end
86
+ end
87
+
88
+ protected
89
+
90
+ def initialize(account_urn, user_cert, credentials, am_manager)
91
+ super()
92
+
93
+ @user_cert = user_cert
94
+
95
+ # NOTE: We only look at the first cred
96
+ credential = credentials[0]
97
+ debug "cred: #{credential.inspect}"
98
+ unless (user_cert.user_urn == credential.user_urn)
99
+ raise OMF::SFA::AM::InsufficientPrivilegesException.new "User urn mismatch in certificate and credentials. cert:'#{user_cert.user_urn}' cred:'#{credential.user_urn}'"
100
+ end
101
+
102
+ @user_cred = credential
103
+
104
+
105
+ if credential.type == 'slice'
106
+ if credential.privilege?('*')
107
+ @permissions[:can_create_account?] = true
108
+ @permissions[:can_view_account?] = true
109
+ @permissions[:can_renew_account?] = true
110
+ @permissions[:can_close_account?] = true
111
+ else
112
+ @permissions[:can_create_account?] = credential.privilege?('control')
113
+ @permissions[:can_view_account?] = credential.privilege?('info')
114
+ @permissions[:can_renew_account?] = credential.privilege?('refresh')
115
+ @permissions[:can_close_account?] = credential.privilege?('control')
116
+ end
117
+ end
118
+
119
+ if credential.privilege?('*')
120
+ @permissions[:can_create_resource?] = true
121
+ @permissions[:can_view_resource?] = true
122
+ @permissions[:can_release_resource?] = true
123
+
124
+ @permissions[:can_view_lease?] = true
125
+ @permissions[:can_modify_lease?] = true
126
+ @permissions[:can_release_lease?] = true
127
+ else
128
+ @permissions[:can_create_resource?] = credential.privilege?('refresh')
129
+ @permissions[:can_view_resource?] = credential.privilege?('info')
130
+ @permissions[:can_release_resource?] = credential.privilege?('refresh')
131
+
132
+ @permissions[:can_view_lease?] = credential.privilege?('info')
133
+ @permissions[:can_modify_lease?] = credential.privilege?('refresh')
134
+ @permissions[:can_release_lease?] = credential.privilege?('refresh')
135
+ end
136
+
137
+
138
+ debug "Have permission '#{@permissions.inspect}'"
139
+
140
+ unless account_urn.nil?
141
+ unless account_urn.eql?(credential.target_urn)
142
+ raise OMF::SFA::AM::InsufficientPrivilegesException.new "Slice urn mismatch in XML call and credentials"
143
+ end
144
+
145
+ @account = am_manager.find_or_create_account({:urn => account_urn}, self)
146
+ @account.valid_until = @user_cred.valid_until
147
+ if @account.closed?
148
+ if @permissions[:can_create_account?]
149
+ @account.closed_at = nil
150
+ else
151
+ raise OMF::SFA::AM::InsufficientPrivilegesException.new("You don't have the privilege to enable a closed account")
152
+ end
153
+ end
154
+ # XXX: decide where/when to create the Project. Right now we are creating it along with the account in the above method
155
+ @project = @account.project
156
+ end
157
+
158
+ end
159
+
160
+ end
161
+ end
@@ -0,0 +1,450 @@
1
+
2
+ module OMF::SFA::ServiceAPI
3
+ Struct.new("MethodDescription", :rpc_name, :method_name, :opts)
4
+
5
+ # This defines a method to declare the service methods and all their
6
+ # parameters.
7
+ #
8
+ def declare(rpc_name, method_name, opts = {}, &block)
9
+ @@declarations ||= {}
10
+ m = (@@declarations[self] ||= [])
11
+ m << Struct::MethodDescription.new(rpc_name.to_sym, method_name.to_sym, opts)
12
+ end
13
+
14
+ def api_description()
15
+ @@declarations ||= {}
16
+ @@declarations[self] || []
17
+ end
18
+
19
+ end
20
+
21
+
22
+ module OMF::SFA::AM::RPC::AMServiceAPI
23
+ extend OMF::SFA::ServiceAPI
24
+
25
+ declare :GetVersion, :get_version, {
26
+ :short => "",
27
+ :params => {},
28
+ :return => {
29
+ :type => :hash,
30
+ :description => %{
31
+ Return the version of the GENI Aggregate API
32
+ supported by this aggregate.
33
+ },
34
+ :params => [
35
+ {
36
+ :name => 'geni_api',
37
+ :type => :integer,
38
+ :descriptiosn => %{
39
+ Indicating the revision of the Aggregate Manager API that
40
+ an aggregate supports. The current version of the API
41
+ is 1 (one).
42
+ }
43
+ }
44
+ ]
45
+ }
46
+ }
47
+
48
+ declare :ListResources, :list_resources, {
49
+ :short => %{Return information about available resources
50
+ or resources allocated to a slice.},
51
+ :params => [
52
+ {
53
+ :name => 'credentials',
54
+ :type => :array,
55
+ :description => %{
56
+ An array of credentials. At least one credential must
57
+ be valid for this operation (signed by a valid GENI certificate
58
+ authority either directly or by chain, and not expired). Note that
59
+ the semantics of this argument is not clear. Alternative
60
+ interpretations might, for example, accumulate privileges from each
61
+ valid credential to determine overall caller permissions.
62
+ }
63
+ }, {
64
+ :name => 'options',
65
+ :type => :hash,
66
+ :description => %{
67
+ A hash containing members indicating the set of resources
68
+ the caller is interested in or the format of the result. In addition
69
+ to the members specified below, callers can pass additional members
70
+ that specific aggregate manager implementations might honor. The
71
+ prefix geni_ is reserved for members that are part of this API
72
+ specification. Implementations should choose an appropriate prefix
73
+ to avoid conflicts.
74
+
75
+ The following members are available for use in the options
76
+ parameter. All aggregate managers are required to implement these
77
+ options.},
78
+ :params => [
79
+ {
80
+ :name => 'geni_available',
81
+ :type => :boolean,
82
+ :description => %{
83
+ A boolean value indicating whether the caller is
84
+ interested in all resources or available resources. If this value
85
+ is true, the result should contain only available resources. If
86
+ this value is false both available and allocated resources should
87
+ be returned. The Aggregate Manager is free to limit visibility of
88
+ certain resources based on the credentials parameter.
89
+ }
90
+ }, {
91
+ :name => 'geni_compressed',
92
+ :type => :boolean,
93
+ :description => %{
94
+ A boolean value indicating whether the caller
95
+ would like the result to be compressed. If the value is true, the
96
+ returned resource list will be compressed according to RFC 1950.
97
+ }
98
+ }, {
99
+ :name => 'geni_slice_urn',
100
+ :type => :string,
101
+ :description => %{
102
+ A string indicating that the caller is interested
103
+ in the set of resources allocated to the slice named by this
104
+ URN. If no resources are allocated to the indicated slice by this
105
+ aggregate, an empty RSPEC should be returned. }
106
+ }
107
+ ]
108
+ }
109
+ ],
110
+ :return => {
111
+ :type => :hash,
112
+ :description => %{
113
+ For ListResources, value is an RSpec listing and describing resources
114
+ at this aggregate. Depending on the arguments, this may be an advertisement
115
+ RSpec showing all local resources, or one showing only available local resources,
116
+ or a manifest RSpec of resources reserved for a particular slice.
117
+ },
118
+ :params => [
119
+ {
120
+ :name => 'code',
121
+ :type => :hash,
122
+ :description => %{
123
+ A struct indicating the success or failure of this call at
124
+ the Aggregate Manager. It consists of 1 required field and 2 optional fields.
125
+ },
126
+ :params => [
127
+ {
128
+ :name => 'geni_code',
129
+ :type => :integer,
130
+ :description => %{
131
+ An integer supplying the GENI standard return code indicating
132
+ the success or failure of this call. Error codes are standardized
133
+ and defined in the attached XML document. Codes may be negative.
134
+ A success return is defined as geni_code of 0.
135
+ }
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ :name => 'value',
141
+ :type => :text_xml,
142
+ :description => %{
143
+ For ListResources, value is an RSpec listing and describing resources at
144
+ this aggregate. Depending on the arguments, this may be an advertisement
145
+ RSpec showing all local resources, or one showing only available local
146
+ resources, or a manifest RSpec of resources reserved for a particular slice.
147
+ }
148
+ }
149
+ ]
150
+ }
151
+ }
152
+
153
+ declare :CreateSliver, :create_sliver, {
154
+ :description => %{
155
+ Allocate resources to a slice. This operation is expected to start the
156
+ allocated resources asynchronously after the operation has
157
+ successfully completed. Callers can check on the status of the
158
+ resources using SliverStatus.
159
+ },
160
+ :params => [
161
+ {
162
+ :name => 'slice_urn',
163
+ :type => :string_urn,
164
+ :description => %{
165
+ The URN of the slice to which the resources specified in
166
+ rspec will be allocated.
167
+ }
168
+ },
169
+ {
170
+ :name => 'credentials',
171
+ :type => :array,
172
+ :description => %{
173
+ An array of credentials. At least one credential must be a
174
+ valid slice credential for the slice specified in
175
+ slice_urn. Note that the semantics of this argument is not
176
+ clear. Alternative interpretations might, for example,
177
+ accumulate privileges from each valid credential to
178
+ determine overall caller permissions. Aggregates should
179
+ ensure that the expiration time of the slice does not exceed
180
+ the expiration time of the slice credential used to perform
181
+ this operation.
182
+ }
183
+ }, {
184
+ :name => 'rspec',
185
+ :type => :text_xml,
186
+ :description => %{
187
+ An RSPEC containing the resources that the caller is
188
+ requesting for allocation to the slice specified in
189
+ slice_urn. These are expected to be based on resources
190
+ returned by a previous invocation of ListResources.
191
+ }
192
+ }, {
193
+ :name => 'users',
194
+ :type => :array,
195
+ :description => %{
196
+ An array of user structs, which contain information about
197
+ the users that might login to the sliver that the AM needs
198
+ to know about. Each struct must include the key 'keys',
199
+ which is an array of strings and can be empty. The struct
200
+ must also include the key 'urn', which is the user's URN
201
+ string. The users array can be empty. For example:
202
+
203
+ [
204
+ {
205
+ urn: urn:publicid:IDN+geni.net:gcf+user+alice
206
+ keys: [<ssh key>, <ssh key>]
207
+ },
208
+ {
209
+ urn: urn:publicid:IDN+geni.net:gcf+user+bob
210
+ keys: [<ssh key>]
211
+ }
212
+ ]
213
+ }
214
+ }
215
+ ],
216
+ :return => {
217
+ :type => :text_xml,
218
+ :description => %{
219
+ The return value is an RSPEC indicating the resources that
220
+ were allocated to the slice. The result RSPEC may contain
221
+ additional information about the allocated resources.
222
+ }
223
+ }
224
+ }
225
+
226
+ declare :DeleteSliver, :delete_sliver, {
227
+ :description => %{
228
+ Delete a sliver by stopping it if it is still running, and then
229
+ deallocating the resources associated with it. This call will
230
+ stop and deallocate all resources associated with the given
231
+ slice URN.
232
+ },
233
+ :params => [
234
+ {
235
+ :name => 'slice_urn',
236
+ :type => :string_urn,
237
+ :description => %{
238
+ The URN of the slice whose sliver should be deleted.
239
+ }
240
+ }, {
241
+ :name => 'credentials',
242
+ :type => :array,
243
+ :description => %{
244
+ An array of credentials. At least one credential must be a
245
+ valid slice credential for the slice specified in
246
+ slice_urn. Note that the semantics of this argument is not
247
+ clear. Alternative interpretations might, for example,
248
+ accumulate privileges from each valid credential to
249
+ determine overall caller permissions.
250
+ }
251
+ }
252
+ ],
253
+ :return => {
254
+ :type => :boolean,
255
+ :description => %{
256
+ Returns true on success and false on failure.
257
+ }
258
+ }
259
+ }
260
+
261
+ declare :SliverStatus, :sliver_status, {
262
+ :description => "Get the status of a sliver.",
263
+ :params => [
264
+ {
265
+ :name => 'slice_urn',
266
+ :type => :string_urn,
267
+ :description => %{
268
+ The URN of the slice for which the sliver status is requested.
269
+ }
270
+ }, {
271
+ :name => 'credentials',
272
+ :type => :array,
273
+ :description => %{
274
+ An array of credentials. At least one credential must be a
275
+ valid slice credential for the slice specified in
276
+ slice_urn. Note that the semantics of this argument is not
277
+ clear. Alternative interpretations might, for example,
278
+ accumulate privileges from each valid credential to
279
+ determine overall caller permissions.
280
+ }
281
+ }
282
+ ],
283
+ :return => {
284
+ :type => :hash,
285
+ :description => %{
286
+ Returns an XMLRPC struct upon successful completion. The
287
+ struct is of the following form:
288
+ },
289
+ :params => [
290
+ {
291
+ :name => 'geni_urn',
292
+ :type => :string_urn,
293
+ :descriptions => %{
294
+ The URN of the sliver as a string. This is the sliver and
295
+ not the slice, and should be selected by the aggregate
296
+ manager.
297
+ }
298
+ }, {
299
+ :name => 'geni_status',
300
+ :type => :string,
301
+ :descriptions => %{
302
+ A string indicating the status of the sliver. Possible
303
+ values are: _configuring_, _ready_, _failed_, and
304
+ _unknown_. Configuring indicates that at least one resource
305
+ is being configured and none have failed. Ready indicates
306
+ that all resources in the sliver are ready. Failed
307
+ indicates that at least one resource in the sliver has
308
+ failed. Unknown indicates that the state of the sliver is
309
+ not one of the known states. More detailed information can
310
+ be found in the value of the geni_resources member.
311
+ }
312
+ }, {
313
+ :name => 'geni_resources',
314
+ :type => :array,
315
+ :descriptions => %{
316
+ An array of structs. Each struct in the array gives the
317
+ status of each resource in the sliver. The members of
318
+ these structs are described below.
319
+
320
+ The members of the resource struct(s) are as follows:
321
+ },
322
+ :params => [
323
+ {
324
+ :name => 'geni_urn',
325
+ :type => :string_urn,
326
+ :descriptions => %{
327
+ The URN of the resource as a string. This is specific
328
+ to the sliver, and should be selected by the aggregate
329
+ manager to allow status reporting and control at the
330
+ finest level supported at that aggregate. It may be a
331
+ sliver URN if there is only 1 resource in the sliver.
332
+ }
333
+ }, {
334
+ :name => 'geni_status',
335
+ :type => :string,
336
+ :descriptions => %{
337
+ A string indicating the status of the
338
+ resource. Possible values are: _configuring_, _ready_,
339
+ _failed_, and _unknown_. *Configuring* indicates that the
340
+ resources is being configured and is not yet ready for
341
+ use. *Ready* indicates that the resource is
342
+ ready. *Failed* indicates that the resource has
343
+ failed. *Unknown* indicates that the state of the
344
+ resource is not one of the known states.
345
+ }
346
+ }, {
347
+ :name => 'geni_error',
348
+ :type => :string,
349
+ :descriptions => %{
350
+ A free form string. The aggregate manager should set
351
+ this to a string that could be presented to a
352
+ researcher to give more detailed information about
353
+ the state of the resource if its status is failed.
354
+ }
355
+ }
356
+ ]
357
+ }
358
+ ]
359
+ }
360
+ }
361
+
362
+ declare :RenewSliver, :renew_sliver, {
363
+ :description => %{
364
+ Renews the resources in a sliver, extending the lifetime of the slice.
365
+
366
+ It is assumed that the caller will have already extended the
367
+ lifetime of the slice credential with the appropriate slice
368
+ authority prior to calling _RenewSliver_.
369
+ },
370
+ :params => [
371
+ {
372
+ :name => 'slice_urn',
373
+ :type => :string_urn,
374
+ :description => %{
375
+ The URN of the slice that is to have its sliver renewed.
376
+ }
377
+ }, {
378
+ :name => 'credentials',
379
+ :type => :array,
380
+ :description => %{
381
+ An array of credentials. At least one credential must be a
382
+ valid slice credential for the slice specified in
383
+ slice_urn. Note that the semantics of this argument is not
384
+ clear. Alternative interpretations might, for example,
385
+ accumulate privileges from each valid credential to
386
+ determine overall caller permissions.
387
+ }
388
+ }, {
389
+ :name => 'expiration_time',
390
+ :type => :string_date,
391
+ :description => %{
392
+ A string in RFC 3339 format indicating the expiration_time
393
+ desired by the caller. Note these times, per the RFC, must
394
+ be in or relative to UTC. This time must be less than or
395
+ equal to the slice duration in the slice credential. In
396
+ other words, at least one supplied (slice) credential must
397
+ still be valid at the desired new expiration time for this
398
+ call to succeed.
399
+ }
400
+ }
401
+ ],
402
+ :return => {
403
+ :type => :boolean,
404
+ :description => %{
405
+ Returns true on successful completion, false otherwise.
406
+ }
407
+ }
408
+ }
409
+
410
+ declare :Shutdown, :shutdown_sliver, {
411
+ :description => %{
412
+ Perform an emergency shut down of a sliver. This operation is
413
+ intended for administrative use. The sliver is shut down but
414
+ remains available for further forensics.
415
+ },
416
+ :params => [
417
+ {
418
+ :name => 'slice_urn',
419
+ :type => :string_urn,
420
+ :description => %{
421
+ The URN of the slice is to have its sliver shut down.
422
+ }
423
+ }, {
424
+ :name => 'credentials',
425
+ :type => :array,
426
+ :description => %{
427
+ An array of credentials. At least one credential must be a
428
+ valid slice credential for the slice specified in slice_urn
429
+ or a valid administrative credential with sufficient
430
+ privileges. Note that the semantics of this argument is not
431
+ clear. Alternative interpretations might, for example,
432
+ accumulate privileges from each valid credential to
433
+ determine overall caller permissions.
434
+ }
435
+ }
436
+ ],
437
+ :return => {
438
+ :type => :boolean,
439
+ :description => %{
440
+ Returns true on success, false otherwise.
441
+ }
442
+ }
443
+ }
444
+
445
+ end # module OMF::SFA:AM
446
+
447
+
448
+
449
+
450
+