Class: StudioApi::Repository

Inherits:
ActiveResource::Base
  • Object
show all
Extended by:
StudioResource
Defined in:
lib/studio_api/repository.rb

Overview

Represents available repositories for appliance.

Allows finding and importing repositories. When using find :all then there is optional parameters for base_system and filter

Examples:

Find repository with kde for SLE11

StudioApi::Repository.find :all, :params => { :base_system => "sle11", :filter => "kde" }

Class Method Summary (collapse)

Methods included from StudioResource

collection_path, element_path, extended, studio_connection, studio_connection=

Class Method Details

+ (StudioApi::Repository) import(url, name)

Import new repository to Studio

note: Repository will be available to everyone

Parameters:

  • url (#to_s)

    to repository

  • name (#to_s)

    of created repository

Returns:



23
24
25
26
27
# File 'lib/studio_api/repository.rb', line 23

def self.import (url, name)
  response = post '',:url => url, :name => name
  attrs = Hash.from_xml response.body
  Repository.new attrs["repository"]
end