idx
int64
0
24.9k
question
stringlengths
68
4.14k
target
stringlengths
9
749
10,400
def get_term_for_section ( id , opts = { } ) data , _status_code , _headers = get_term_for_section_with_http_info ( id , opts ) return data end
Returns the term for a section
10,401
def get_event ( id , opts = { } ) data , _status_code , _headers = get_event_with_http_info ( id , opts ) return data end
Returns the specific event
10,402
def setup_socket ctx = setup_certificate APN . log ( :debug , "Connecting to #{@host}:#{@port}..." ) socket_tcp = TCPSocket . new ( @host , @port ) OpenSSL :: SSL :: SSLSocket . new ( socket_tcp , ctx ) . tap do | s | s . sync = true s . connect end end
Open socket to Apple s servers
10,403
def dot ( a , b ) a = NArray . asarray ( a ) b = NArray . asarray ( b ) case a . ndim when 1 case b . ndim when 1 func = blas_char ( a , b ) =~ / / ? :dotu : :dot Blas . call ( func , a , b ) else if b . contiguous? trans = 't' else if b . fortran_contiguous? trans = 'n' b = b . transpose else trans = 't' b = b . dup e...
module methods Matrix and vector products Dot product .
10,404
def matrix_power ( a , n ) a = NArray . asarray ( a ) m , k = a . shape [ - 2 .. - 1 ] unless m == k raise NArray :: ShapeError , "input must be a square array" end unless Integer === n raise ArgumentError , "exponent must be an integer" end if n == 0 return a . class . eye ( m ) elsif n < 0 a = inv ( a ) n = n . abs e...
Compute a square matrix a to the power n .
10,405
def svdvals ( a , driver : 'svd' ) case driver . to_s when / /i , "turbo" Lapack . call ( :gesdd , a , jobz : 'N' ) [ 0 ] when / /i Lapack . call ( :gesvd , a , jobu : 'N' , jobvt : 'N' ) [ 0 ] else raise ArgumentError , "invalid driver: #{driver}" end end
Computes the Singular Values of a M - by - N matrix A . The SVD is written
10,406
def orth ( a , rcond : - 1 ) raise NArray :: ShapeError , '2-d array is required' if a . ndim < 2 s , u , = svd ( a ) tol = s . max * ( rcond . nil? || rcond < 0 ? a . class :: EPSILON * a . shape . max : rcond ) k = ( s > tol ) . count u [ true , 0 ... k ] end
Computes an orthonormal basis for the range of matrix A .
10,407
def null_space ( a , rcond : - 1 ) raise NArray :: ShapeError , '2-d array is required' if a . ndim < 2 s , _u , vh = svd ( a ) tol = s . max * ( rcond . nil? || rcond < 0 ? a . class :: EPSILON * a . shape . max : rcond ) k = ( s > tol ) . count return a . class . new if k == vh . shape [ 0 ] r = vh [ k .. - 1 , true ...
Computes an orthonormal basis for the null space of matrix A .
10,408
def lu ( a , permute_l : false ) raise NArray :: ShapeError , '2-d array is required' if a . ndim < 2 m , n = a . shape k = [ m , n ] . min lu , ip = lu_fact ( a ) l = lu . tril . tap { | mat | mat [ mat . diag_indices ( 0 ) ] = 1.0 } [ true , 0 ... k ] u = lu . triu [ 0 ... k , 0 ... n ] p = Numo :: DFloat . eye ( m )...
Computes an LU factorization of a M - by - N matrix A using partial pivoting with row interchanges .
10,409
def lu_solve ( lu , ipiv , b , trans : "N" ) Lapack . call ( :getrs , lu , ipiv , b , trans : trans ) [ 0 ] end
Solves a system of linear equations
10,410
def eigvals ( a ) jobvl , jobvr = 'N' , 'N' case blas_char ( a ) when / / w , = Lapack . call ( :geev , a , jobvl : jobvl , jobvr : jobvr ) else wr , wi , = Lapack . call ( :geev , a , jobvl : jobvl , jobvr : jobvr ) w = wr + wi * Complex :: I end w end
Computes the eigenvalues only for a square nonsymmetric matrix A .
10,411
def cond ( a , ord = nil ) if ord . nil? s = svdvals ( a ) s [ false , 0 ] / s [ false , - 1 ] else norm ( a , ord , axis : [ - 2 , - 1 ] ) * norm ( inv ( a ) , ord , axis : [ - 2 , - 1 ] ) end end
Compute the condition number of a matrix using the norm with one of the following order .
10,412
def det ( a ) lu , piv , = Lapack . call ( :getrf , a ) idx = piv . new_narray . store ( piv . class . new ( piv . shape [ - 1 ] ) . seq ( 1 ) ) m = piv . eq ( idx ) . count_false ( axis : - 1 ) % 2 sign = m * - 2 + 1 lu . diagonal . prod ( axis : - 1 ) * sign end
Determinant of a matrix
10,413
def slogdet ( a ) lu , piv , = Lapack . call ( :getrf , a ) idx = piv . new_narray . store ( piv . class . new ( piv . shape [ - 1 ] ) . seq ( 1 ) ) m = piv . eq ( idx ) . count_false ( axis : - 1 ) % 2 sign = m * - 2 + 1 lud = lu . diagonal if ( lud . eq 0 ) . any? return 0 , ( - Float :: INFINITY ) end lud_abs = lud ...
Natural logarithm of the determinant of a matrix
10,414
def inv ( a , driver : "getrf" , uplo : 'U' ) case driver when / / d = $1 b = a . new_zeros . eye solve ( a , b , driver : d , uplo : uplo ) when / / d = $1 lu , piv = lu_fact ( a ) lu_inv ( lu , piv ) when / / lu = cho_fact ( a , uplo : uplo ) cho_inv ( lu , uplo : uplo ) else raise ArgumentError , "invalid driver: #{...
Inverse matrix from square matrix a
10,415
def valid? unvalidated_fields = @data . keys . dup for property_key , schema_class in self . class . properties property_value = @data [ property_key ] if ! self . class . validate_property_value ( property_value , schema_class . data ) return false end if property_value == nil && schema_class . data [ 'required' ] != ...
Validates the parsed data against the schema .
10,416
def render_crumbs ( options = { } ) raise ArgumentError , "Renderer and block given" if options . has_key? ( :renderer ) && block_given? return yield ( crumbs , options ) if block_given? @_renderer ||= if options . has_key? ( :renderer ) options . delete ( :renderer ) else require 'crummy/standard_renderer' Crummy :: S...
Render the list of crumbs using renderer
10,417
def javascript ( value = nil , attributes = { } ) if value . is_a? ( Hash ) attributes = value value = nil elsif block_given? && value raise ArgumentError , "You can't pass both a block and a value to javascript -- please choose one." end script ( attributes . merge ( :type => "text/javascript" ) ) do output << raw ( "...
Emits a javascript block inside a + script + tag wrapped in CDATA doohickeys like all the cool JS kids do .
10,418
def pmt ( options = { } ) future_value = options . fetch ( :future_value , 0 ) type = options . fetch ( :type , 0 ) ( ( @amount * interest ( @monthly_rate , @duration ) - future_value ) / ( ( 1.0 + @monthly_rate * type ) * fvifa ( @monthly_rate , duration ) ) ) end
create a new Loan instance
10,419
def jquery ( * args ) event = if args . first . is_a? Symbol args . shift else :ready end txt = args . shift attributes = args . shift || { } javascript attributes do rawtext "\n" rawtext "jQuery(document).#{event}(function($){\n" rawtext txt rawtext "\n});" end end
Emits a jQuery script inside its own script tag that is to be run on document ready or load .
10,420
def capture_content original , @_output = output , Output . new yield original . widgets . concat ( output . widgets ) output . to_s ensure @_output = original end
Creates a whole new output string executes the block then converts the output string to a string and returns it as raw text . If at all possible you should avoid this method since it hurts performance and use + widget + instead .
10,421
def _emit_via ( parent , options = { } , & block ) _emit ( options . merge ( :parent => parent , :output => parent . output , :helpers => parent . helpers ) , & block ) end
same as _emit but using a parent widget s output stream and helpers
10,422
def render ( * args , & block ) captured = helpers . capture do helpers . concat ( helpers . render ( * args , & block ) ) helpers . output_buffer . to_s end rawtext ( captured ) end
Wrap Rails render method to capture output from partials etc .
10,423
def content_for ( * args , & block ) if block helpers . content_for ( * args , & block ) else rawtext ( helpers . content_for ( * args ) ) '' end end
Rails content_for is output if and only if no block given
10,424
def character ( code_point_or_name ) if code_point_or_name . is_a? ( Symbol ) require "erector/unicode" found = Erector :: CHARACTERS [ code_point_or_name ] if found . nil? raise "Unrecognized character #{code_point_or_name}" end raw ( "&#x#{sprintf '%x', found};" ) elsif code_point_or_name . is_a? ( Integer ) raw ( "&...
Return a character given its unicode code point or unicode name .
10,425
def method_missing ( name , & block ) @formats . push ( [ name , block || proc { } ] ) unless @formats . any? { | n , b | n == name } end
Returns a new Response with no format data . Used to dispatch the individual format methods .
10,426
def can_block? ( friendable ) active? && ( approved? || ( pending? && self . friend_id == friendable . id && friendable . class . to_s == Amistad . friend_model ) ) end
returns true if a friendship can be blocked by given friendable
10,427
def can_unblock? ( friendable ) blocked? && self . blocker_id == friendable . id && friendable . class . to_s == Amistad . friend_model end
returns true if a friendship can be unblocked by given friendable
10,428
def add ( severity , message ) severity = TileUpLogger . sym_to_severity ( severity ) logger . add ( severity , message ) end
add message to log
10,429
def deployment return nil if target . nil? if @config_file . has_key? ( "deployment" ) if is_old_deployment_config? set_deployment ( @config_file [ "deployment" ] ) save end if @config_file [ "deployment" ] . is_a? ( Hash ) return @config_file [ "deployment" ] [ target ] end end end
Read the deployment configuration . Return the deployment for the current target .
10,430
def apply apply_publish kontroller = @controller Resourceful :: ACTIONS . each do | action_named | unless @ok_actions . include? action_named @action_module . send :remove_method , action_named end end kontroller . hidden_actions . reject! & @ok_actions . method ( :include? ) kontroller . send :include , @action_module...
The constructor is only meant to be called internally .
10,431
def belongs_to ( * parents ) options = parents . extract_options! @parents = parents . map ( & :to_s ) if options [ :shallow ] options [ :shallow ] = options [ :shallow ] . to_s raise ArgumentError , ":shallow needs the name of a parent resource" unless @parents . include? options [ :shallow ] @shallow_parent = options...
Specifies parent resources for the current resource . Each of these parents will be loaded automatically if the proper id parameter is given . For example
10,432
def blocked? ( user ) ( blocked_friend_ids + blocked_inverse_friend_ids + blocked_pending_inverse_friend_ids ) . include? ( user . id ) or user . blocked_pending_inverse_friend_ids . include? ( self . id ) end
checks if a user is blocked
10,433
def friendshiped_with? ( user ) ( friend_ids + inverse_friend_ids + pending_friend_ids + pending_inverse_friend_ids + blocked_friend_ids ) . include? ( user . id ) end
check if any friendship exists with another user
10,434
def delete_all_friendships friend_ids . clear inverse_friend_ids . clear pending_friend_ids . clear pending_inverse_friend_ids . clear blocked_friend_ids . clear blocked_inverse_friend_ids . clear blocked_pending_friend_ids . clear blocked_pending_inverse_friend_ids . clear self . save end
deletes all the friendships
10,435
def render ( options = nil , deprecated_status_or_extra_options = nil , & block ) if :: Rails :: VERSION :: STRING >= '2.0.0' && deprecated_status_or_extra_options . nil? deprecated_status_or_extra_options = { } end unless block_given? if @template . respond_to? ( :finder ) ( class << @template . finder ; self ; end ) ...
From rspec - rails ControllerExampleGroup
10,436
def unblock ( user ) friendship = find_any_friendship_with ( user ) return false if friendship . nil? || ! friendship . can_unblock? ( self ) friendship . update_attribute ( :blocker , nil ) end
unblocks a friendship
10,437
def find_any_friendship_with ( user ) friendship = Amistad . friendship_class . where ( :friendable_id => self . id , :friend_id => user . id ) . first if friendship . nil? friendship = Amistad . friendship_class . where ( :friendable_id => user . id , :friend_id => self . id ) . first end friendship end
returns friendship with given user or nil
10,438
def re_define_method ( name , & block ) undef_method ( name ) if method_defined? ( name ) define_method ( name , & block ) end
Redefine the method . Will undef the method if it exists or simply just define it .
10,439
def rdf_type ( new_rdf_type ) self . _RDF_TYPE = RDF :: URI . new ( new_rdf_type . to_s ) field :rdf_type , RDF . type , :multivalued => true , :is_uri => true end
makes a field on this model called rdf_type and sets a class level _RDF_TYPE variable with the rdf_type passed in .
10,440
def p ( * delta , ** metadata ) delta = delta . compact . empty? ? @delta : delta Pattern . new ( @source , delta : delta , size : @size , ** @metadata . merge ( metadata ) ) end
Returns a new Pattern with the same + source + but with + delta + overriden and + metadata + merged .
10,441
def each_event ( cycle = 0 ) return enum_for ( __method__ , cycle ) unless block_given? EventEnumerator . new ( self , cycle ) . each { | v , s , d , i | yield v , s , d , i } end
Calls the given block once for each event passing its value start position duration and iteration as parameters .
10,442
def each_delta ( index = 0 ) return enum_for ( __method__ , index ) unless block_given? delta = @delta if delta . is_a? ( Array ) size = delta . size return if size == 0 start = index . floor i = start % size loop do yield delta [ i ] i = ( i + 1 ) % size start += 1 end elsif delta . is_a? ( Pattern ) delta . each_even...
Calls the given block passing the delta of each value in pattern
10,443
def each return enum_for ( __method__ ) unless block_given? each_event { | v , _ , _ , i | break if i > 0 yield v } end
Calls the given block once for each value in source
10,444
def select return enum_for ( __method__ ) unless block_given? Pattern . new ( self ) do | y , d | each_event do | v , s , ed , i | y << v if yield ( v , s , ed , i ) end end end
Returns a Pattern containing all events of + self + for which + block + is true .
10,445
def reject return enum_for ( __method__ ) unless block_given? select { | v , s , d , i | ! yield ( v , s , d , i ) } end
Returns a Pattern containing all events of + self + for which + block + is false .
10,446
def first ( n = nil , * args ) res = take ( n || 1 , * args ) n . nil? ? res . first : res end
Returns the first element or the first + n + elements of the pattern .
10,447
def inspect ss = if @source . respond_to? ( :join ) @source . map ( & :inspect ) . join ( ', ' ) elsif @source . is_a? ( Proc ) "?proc" else @source . inspect end ms = @metadata . reject { | _ , v | v . nil? } ms . merge! ( delta : delta ) if delta != 1 ms = ms . map { | k , v | "#{k}: #{v.inspect}" } . join ( ', ' ) "...
Returns a string containing a human - readable representation
10,448
def get_field ( name ) @fields ||= { } field = fields [ name ] raise Tripod :: Errors :: FieldNotPresent . new unless field field end
Return the field object on a + Resource + associated with the given name .
10,449
def fields tripod_superclasses . map { | c | c . instance_variable_get ( :@fields ) } . reduce do | acc , class_fields | class_fields . merge ( acc ) end end
Return all of the fields on a + Resource + in a manner that respects Ruby s inheritance rules . i . e . subclass fields should override superclass fields with the same
10,450
def add_field ( name , predicate , options = { } ) field = field_for ( name , predicate , options ) @fields ||= { } @fields [ name ] = field create_accessors ( name , name , options ) validates ( name , is_url : true ) if field . is_uri? field end
Define a field attribute for the + Resource + .
10,451
def create_accessors ( name , meth , options = { } ) field = @fields [ name ] create_field_getter ( name , meth , field ) create_field_setter ( name , meth , field ) create_field_check ( name , meth , field ) create_dirty_methods ( name , meth ) end
Create the field accessors .
10,452
def create_field_getter ( name , meth , field ) generated_methods . module_eval do re_define_method ( meth ) do read_attribute ( name , field ) end end end
Create the getter method for the provided field .
10,453
def create_field_setter ( name , meth , field ) generated_methods . module_eval do re_define_method ( "#{meth}=" ) do | value | write_attribute ( name , value , field ) end end end
Create the setter method for the provided field .
10,454
def create_field_check ( name , meth , field ) generated_methods . module_eval do re_define_method ( "#{meth}?" ) do attr = read_attribute ( name , field ) attr == true || attr . present? end end end
Create the check method for the provided field .
10,455
def field_for ( name , predicate , options ) Tripod :: Fields :: Standard . new ( name , predicate , options ) end
instantiates and returns a new standard field
10,456
def describe_uris ( uris ) graph = RDF :: Graph . new if uris . length > 0 uris_sparql_str = uris . map { | u | "<#{u.to_s}>" } . join ( " " ) ntriples_string = Tripod :: SparqlClient :: Query . query ( "CONSTRUCT { ?s ?p ?o } WHERE { VALUES ?s { #{uris_sparql_str} }. ?s ?p ?o . }" , Tripod . ntriples_header_str ) gra...
returns a graph of triples which describe the uris passed in .
10,457
def _rdf_graph_from_ntriples_string ( ntriples_string , graph = nil ) graph ||= RDF :: Graph . new RDF :: Reader . for ( :ntriples ) . new ( ntriples_string ) do | reader | reader . each_statement do | statement | graph << statement end end graph end
given a string of ntriples data populate an RDF graph . If you pass a graph in it will add to that one .
10,458
def _graph_of_triples_from_construct_or_describe ( construct_query ) ntriples_str = Tripod :: SparqlClient :: Query . query ( construct_query , Tripod . ntriples_header_str ) _rdf_graph_from_ntriples_string ( ntriples_str , graph = nil ) end
given a construct or describe query return a graph of triples .
10,459
def _create_and_hydrate_resources_from_sparql ( select_sparql , opts = { } ) uris_and_graphs = _select_uris_and_graphs ( select_sparql , :uri_variable => opts [ :uri_variable ] , :graph_variable => opts [ :graph_variable ] ) if uris_and_graphs . empty? [ ] else construct_query = _construct_query_for_uris_and_graphs ( u...
Given a select query perform a DESCRIBE query to get a graph of data from which we create and hydrate a collection of resources .
10,460
def _construct_query_for_uris_and_graphs ( uris_and_graphs ) value_pairs = uris_and_graphs . map do | ( uri , graph ) | u = RDF :: URI . new ( uri ) . to_base g = graph ? RDF :: URI . new ( graph ) . to_base : 'UNDEF' "(#{u} #{g})" end query = "CONSTRUCT { ?uri ?p ?o . #{ self.all_triples_construct("?uri") }} WHERE { G...
Generate a CONSTRUCT query for the given uri and graph pairs .
10,461
def _raw_describe_select_results ( select_sparql , opts = { } ) accept_header = opts [ :accept_header ] || Tripod . ntriples_header_str query = _describe_query_for_select ( select_sparql , :uri_variable => opts [ :uri_variable ] ) Tripod :: SparqlClient :: Query . query ( query , accept_header ) end
For a select query get a raw serialisation of the DESCRIPTION of the resources from the database .
10,462
def to_nt time_serialization ( 'nt' ) do if @criteria @criteria . serialize ( :return_graph => @return_graph , :accept_header => Tripod . ntriples_header_str ) elsif @sparql_query_str && @resource_class @resource_class . _raw_describe_select_results ( @sparql_query_str , :accept_header => Tripod . ntriples_header_str )...
for n - triples we can just concatenate them
10,463
def resources ( opts = { } ) Tripod :: ResourceCollection . new ( self . resource_class . _resources_from_sparql ( self . as_query ( opts ) ) , :return_graph => ( opts . has_key? ( :return_graph ) ? opts [ :return_graph ] : true ) , :criteria => self ) end
Execute the query and return a + ResourceCollection + of all hydrated resources + ResourceCollection + is an + Enumerable + Array - like object .
10,464
def first ( opts = { } ) sq = Tripod :: SparqlQuery . new ( self . as_query ( opts ) ) first_sparql = sq . as_first_query_str self . resource_class . _resources_from_sparql ( first_sparql ) . first end
Execute the query and return the first result as a hydrated resource
10,465
def count ( opts = { } ) sq = Tripod :: SparqlQuery . new ( self . as_query ( opts ) ) count_sparql = sq . as_count_query_str result = Tripod :: SparqlClient :: Query . select ( count_sparql ) if result . length > 0 result [ 0 ] [ "tripod_count_var" ] [ "value" ] . to_i else return 0 end end
Return how many records the current criteria would return
10,466
def as_query ( opts = { } ) Tripod . logger . debug ( "TRIPOD: building select query for criteria..." ) return_graph = opts . has_key? ( :return_graph ) ? opts [ :return_graph ] : true Tripod . logger . debug ( "TRIPOD: with return_graph: #{return_graph.inspect}" ) select_query = "SELECT DISTINCT ?uri " if graph_lambda...
turn this criteria into a query
10,467
def add_data_to_repository ( graph , repo = nil ) repo ||= RDF :: Repository . new ( ) graph . each_statement do | statement | repo << statement end repo end
for triples in the graph passed in add them to the passed in repository obj and return the repository objects if no repository passed make a new one .
10,468
def graph ( graph_uri , & block ) if block_given? self . graph_lambdas ||= [ ] self . graph_lambdas << block self else self . graph_uri = graph_uri . to_s self end end
Restrict this query to the graph uri passed in You may also pass a block to an unbound graph ?g then chain a where clause to the criteria returned to bind ?g
10,469
def linked_from_for ( name , incoming_field_name , options ) Tripod :: Links :: LinkedFrom . new ( name , incoming_field_name , options ) end
instantiates and returns a new LinkedFrom
10,470
def linked_to_for ( name , predicate , options ) Tripod :: Links :: LinkedTo . new ( name , predicate , options ) end
instantiates and returns a new LinkTo
10,471
def validate_branch_name ( name , id ) if GitUtils . branch_for_story_exists? id prompt . error ( "An existing branch has the same story id: #{id}" ) return false end if GitUtils . existing_branch? name prompt . error ( 'This name is very similar to an existing branch. Avoid confusion and use a more unique name.' ) ret...
Branch name validation
10,472
def value case tag_name when "select" if self [ :multiple ] selected_options . map { | option | option . value } else selected_option = @_node . selected_options . first selected_option ? Node . new ( selected_option ) . value : nil end when "option" self [ :value ] || text when "textarea" @_node . getText else self [ ...
Return the value of a form element . If the element is a select box and has multiple declared as an attribute then all selected options will be returned as an array .
10,473
def value = ( value ) case tag_name when "textarea" @_node . setText ( "" ) type ( value ) when "input" if file_input? @_node . setValueAttribute ( value ) else @_node . setValueAttribute ( "" ) type ( value ) end end end
Set the value of the form input .
10,474
def click @_node . click @_node . getPage . getEnclosingWindow . getJobManager . waitForJobs ( 1000 ) @_node . getPage . getEnclosingWindow . getJobManager . waitForJobsStartingBefore ( 1000 ) end
Click the node and then wait for any triggered JavaScript callbacks to fire .
10,475
def create account = if user_signed_in? Mtdevise :: Account . create ( account_params ) else Mtdevise :: Account . create_with_owner ( account_params ) end @account = account if account . valid? flash [ :success ] = "Your account has been successfully created." if user_signed_in? account . owner = current_user account ...
Accounts Create action
10,476
def get_ws_api_version host_url = @api_url . split ( '/api' ) @http . set_url ( host_url [ 0 ] ) begin response = @http . get ( '/api' ) response [ 1 ] rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end ensure @http . set_url ( @api_url ) end
Get the 3PAR WS API version .
10,477
def create_flash_cache ( size_in_gib , mode = nil ) begin @flash_cache . create_flash_cache ( size_in_gib , mode ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Creates a new FlashCache
10,478
def get_flash_cache begin @flash_cache . get_flash_cache rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Get Flash Cache information
10,479
def delete_flash_cache begin @flash_cache . delete_flash_cache rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Deletes an existing Flash Cache
10,480
def get_overall_system_capacity begin response = @http . get ( '/capacity' ) response [ 1 ] rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Gets the overall system capacity for the 3PAR server .
10,481
def get_all_tasks begin @task . get_all_tasks rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Get the list of all 3PAR Tasks
10,482
def get_task ( task_id ) begin @task . get_task ( task_id ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Get the status of a 3PAR Task
10,483
def create_vlun ( volume_name , lun = nil , host_name = nil , port_pos = nil , no_vcn = false , override_lower_priority = false , auto = false ) begin @vlun . create_vlun ( volume_name , host_name , lun , port_pos , no_vcn , override_lower_priority , auto ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 ...
Creates a new VLUN .
10,484
def get_vluns begin @vlun . get_vluns rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Gets VLUNs .
10,485
def get_vlun ( volume_name ) begin @vlun . get_vlun ( volume_name ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Gets information about a VLUN .
10,486
def delete_vlun ( volume_name , lun_id , host_name = nil , port = nil ) begin @vlun . delete_vlun ( volume_name , lun_id , host_name , port ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Deletes a VLUN .
10,487
def query_qos_rules begin @qos . query_qos_rules rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Gets QoS Rules .
10,488
def query_qos_rule ( target_name , target_type = 'vvset' ) begin @qos . query_qos_rule ( target_name , target_type ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Queries a QoS rule
10,489
def modify_qos_rules ( target_name , qos_rules , target_type = QoStargetTypeConstants :: VVSET ) if @current_version < @min_version && ! qos_rules . nil? qos_rules . delete_if { | key , _value | key == :latencyGoaluSecs } end begin @qos . modify_qos_rules ( target_name , qos_rules , target_type ) rescue => ex Util . lo...
Modifies an existing QOS rules
10,490
def delete_qos_rules ( target_name , target_type = QoStargetTypeConstants :: VVSET ) begin @qos . delete_qos_rules ( target_name , target_type ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Deletes QoS rules .
10,491
def get_hosts begin @host . get_hosts rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Gets all hosts .
10,492
def get_host ( name ) begin @host . get_host ( name ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Gets host information by name .
10,493
def create_host ( name , iscsi_names = nil , fcwwns = nil , optional = nil ) begin @host . create_host ( name , iscsi_names , fcwwns , optional ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Creates a new Host .
10,494
def modify_host ( name , mod_request ) begin @host . modify_host ( name , mod_request ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Modifies an existing Host .
10,495
def delete_host ( name ) begin @host . delete_host ( name ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Deletes a host .
10,496
def query_host_by_fc_path ( wwn = nil ) begin @host . query_host_by_fc_path ( wwn ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Finds the host with the specified FC WWN path .
10,497
def query_host_by_iscsi_path ( iqn = nil ) begin @host . query_host_by_iscsi_path ( iqn ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Finds the host with the specified iSCSI initiator .
10,498
def get_host_sets begin @host_set . get_host_sets rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Gets all host sets .
10,499
def delete_host_set ( name ) begin @host_set . delete_host_set ( name ) rescue => ex Util . log_exception ( ex , caller_locations ( 1 , 1 ) [ 0 ] . label ) raise ex end end
Deletes a HostSet .