此内容没有您所选择的语言版本。

Chapter 2. Using the Software Development Kit


This chapter defines the modules and classes of the Ruby Software Development Kit and describes their usage.

2.1. Classes

The OvirtSDK4 module contains the following software development kit classes:

Connection
The Connection class is the mechanism for connecting to the server and obtaining the reference to the root of the services tree. See Section 3.1, “Connecting to the Red Hat Virtualization Manager” for details.
Types

The Type classes implement the types supported by the API. For example, the Vm class is the implementation of the virtual machine type. The classes are data containers and do not contain any logic. You will be working with instances of types.

Instances of these classes are used as parameters and return values of service methods. The conversion to or from the underlying representation is handled transparently by the software development kit.

Services

The Service classes implement the services supported by the API. For example, the VmsService class is the implementation of the service that manages the collection of virtual machines in the system.

Instances of these classes are automatically created by the SDK when a service is referenced. For example, a new instance of the VmsService class is created automatically by the SDK when you call the vms_service method of the SystemService class:

vms_service = connection.system_service.vms_service
Copy to Clipboard Toggle word wrap
Warning

Do not create instances of these classes manually. The constructor parameters and methods may change in the future.

Error

The Error class is the base exception class that the software development kit raises when it reports an error.

Certain specific error classes extend the base error class:

  • AuthError - Authentication or authorization failure
  • ConnectionError - Server name cannot be resolved or server is unreachable
  • NotFoundError - Requested object does not exist
  • TimeoutError - Operation time-out
Other Classes
Other classes (for example, HTTP client classes, readers, and writers) are used for HTTP communication and for XML parsing and rendering. Using these classes is not recommended, because they comprise internal implementation details that may change in the future. Their backwards-compatibility cannot be relied upon.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat