Compare commits

...

67 Commits
3.3.0 ... 2.2.1

Author SHA1 Message Date
Fabiano Fidêncio
af0fbb9460 Merge pull request #2723 from fidencio/2.2.1-branch-bump
# Kata Containers 2.2.1
2021-09-25 00:02:01 +02:00
Fabiano Fidêncio
bc48a58806 Merge pull request #2731 from fidencio/wip/stable-2.2-release-fix-using-vendored-sources
stable-2.2 | workflows: Fix the config file path for using vendored sources
2021-09-25 00:01:43 +02:00
Fabiano Fidêncio
d581cdab4e Merge pull request #2728 from fidencio/wip/stable-2.2-fix-wrong-tags-attribution
stable-2.2 | workflows: Fix tag attribution
2021-09-24 23:01:18 +02:00
Fabiano Fidêncio
52fdfc4fed workflows: Fix the config file path for using vendored sources
There's a typo in the file that should receive the output of `cargo
vendor`.  We should use forward the output to `.cargo/config` instead of
`.cargo/vendor`.

This was introduced by 21c8511630.

Backports: #2730
Fixes: #2729

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit a525991c2c)
2021-09-24 20:29:15 +02:00
Fabiano Fidêncio
8d98e01414 workflows: Fix tag attribution
While releasing kata-containers 2.3.0-alpha1 we've hit some issues as
the tags attribution is done incorrectly.  We want an array of tags to
iterate over, but the currently code is just lost is the parenthesis.

This issue was introduced in a156288c1f.

Fixes: #2725

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 39dcbaa672)
2021-09-24 20:07:55 +02:00
Fabiano Fidêncio
688cc8e2bd release: Kata Containers 2.2.1
- stable-2.2 | watcher: ensure we create target mount point for storage
- stable-2.2 | virtiofs: Create shared directory with 0700 mode, not 0750
- [backport]sandbox: Allow the device to be accessed,such as /dev/null and /dev/u…
- stable-2.2 | kata-deploy: Also provide "stable" & "latest" tags
- stable-2.2 | runtime: tracing: Fix logger passed in newContainer
- stable-2.2 | runtime: tracing: Use root context to stop tracing
- packaging: Backport QEMU's GitLab switch to 5.1.x
- stable-2.2 | workflows,release: Upload the vendored cargo code
- backport: Call agent shutdown test only in the correspondent CI_JOB
- packaging: Backport QEMU's switch to GitLab repos
- stable-2.2 | virtcontainers: fc: parse vcpuID correctly
- shimv2: Backport fixes for #2527
- backport-2.2: remove default config for arm64.
- stable-2.2 | versions: Upgrade to Cloud Hypervisor v18.0
- [backport]sandbox: Add device permissions such as /dev/null to cgroup
- [backport] runtime: Fix README link
- [backport] snap: Test variable instead of executing "branch"

d9b41fc5 watcher: ensure we create target mount point for storage
2b6327ac kata-deploy: Add more info about the stable tag
5256e085 kata-deploy: Improve README
02b46268 kata-deploy: Remove qemu-virtiofs runtime class
1b3058dd release: update the kata-deploy yaml files accordingly
98e2e935 kata-deploy: Add "stable" info to the README
8f25c7da kata-deploy: Update the README
84da2f8d workflows: Add "stable" & "latest" tags to kata-deploy
5c76f1c6 packaging: Backport QEMU's GitLab switch to 5.1.x
ba6fc328 packaging: Backport QEMU's switch to GitLab repos
d5f5da43 workflows,release: Upload the vendored cargo code
017cd3c5 ci: Call agent shutdown test only in the correspondent CI_JOB
2ca867da runtime: Add container field to logs
f4da502c shimv2: add information to method comment
16164241 shimv2: add logging to shimv2 api calls
25c7e118 virtiofs: Create shared directory with 0700 mode, not 0750
4c5bf057 virtcontainers: fc: parse vcpuID correctly
b3e620db runtime: tracing: Fix logger passed in newContainer
98c2ca13 runtime: tracing: Use root context to stop tracing
0481c507 backport-2.2: remove default config for arm64.
56920bc9 sandbox: Allow the device to be accessed,such as /dev/null and /dev/urandom
a1874ccd virtcontainers: clh: Revert the workaround incorrect default values
c2c65050 virtcontainers: clh: Re-generate the client code
7ee43f94 versions: Upgrade to Cloud Hypervisor v18.0
1792a9fe runtime: Fix README link
807cc8a3 sandbox: Add device permissions such as /dev/null to cgroup
5987f3b5 snap: Test variable instead of executing "branch"

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-09-24 12:34:35 +02:00
Fabiano Fidêncio
ebc23df752 Merge pull request #2714 from egernst/watcher-fixup-backport
stable-2.2 | watcher: ensure we create target mount point for storage
2021-09-24 09:32:29 +02:00
Fabiano Fidêncio
e58fabfc20 Merge pull request #2598 from c3d/backport/2589-virtiofsd-perms-perms
stable-2.2 | virtiofs: Create shared directory with 0700 mode, not 0750
2021-09-24 09:16:59 +02:00
Peng Tao
feb06dad8a Merge pull request #2623 from Bevisy/stable-2.2-2615-bp
[backport]sandbox: Allow the device to be accessed,such as /dev/null and /dev/u…
2021-09-24 14:04:36 +08:00
Eric Ernst
d9b41fc583 watcher: ensure we create target mount point for storage
We would only create the target when updating files. We need to make
sure that we create the target if the source is a directory. Without
this, we'll fail to start a container that utilizes an empty configmap,
for example.

Add unit tests for this.

Fixes: #2638

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-09-23 15:45:57 -07:00
Julio Montes
7852b9f8e1 Merge pull request #2711 from fidencio/wip/stable-2.2-kata-deploy-use-stable-and-latest-tags
stable-2.2 | kata-deploy: Also provide "stable" & "latest" tags
2021-09-23 12:18:00 -05:00
Chelsea Mafrica
83f219577d Merge pull request #2668 from cmaf/tracing-newContainer-logger-bp-2.2
stable-2.2 | runtime: tracing: Fix logger passed in newContainer
2021-09-23 09:58:14 -07:00
Chelsea Mafrica
97421afe17 Merge pull request #2664 from cmaf/tracing-stop-rootctx-bp-2.2
stable-2.2 | runtime: tracing: Use root context to stop tracing
2021-09-23 09:57:57 -07:00
Fabiano Fidêncio
2b6327ac37 kata-deploy: Add more info about the stable tag
Let's make it as clear as possible for the user that if they go for a
tagged version of kata-deploy, eg, 2.2.1, they'll have the kata runtime
2.2.1 deployed on their cluster.

Suggested-by: Eric Adams <eric.adams@intel.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 3bdcfaa658)
2021-09-23 14:05:17 +02:00
Fabiano Fidêncio
5256e0852c kata-deploy: Improve README
Let's add more instructions in the README in order to make clear to the
reader what they can do to check whether kata-deploy is ready, or
whether they have to wait till proceeding with the next instruction.

Suggested-by: Eric Adams <eric.adams@intel.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 41c590fa0a)
2021-09-23 14:04:57 +02:00
Fabiano Fidêncio
02b46268f4 kata-deploy: Remove qemu-virtiofs runtime class
There's only one QEMU runtime class deployed as part of kata-deploy, and
that includes virtiofs support (which is the default for quite some time
already).  Knowing this, let's just remove the `qemu-virtiofs` runtime
class definition.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit debf3c9fe9)
2021-09-23 14:04:50 +02:00
Fabiano Fidêncio
1b3058dd24 release: update the kata-deploy yaml files accordingly
Let's teach our `update-repository-version.sh` script to properly update
the kata-deploy tags on both kata-deploy and kata-cleanup yaml files.

The 3 scenarios that we're dealing with, based on which branch we're
targetting, are:
```
 1) [main] ------> [main]        NO-OP
   "alpha0"       "alpha1"

                   +----------------+----------------+
                   |      from      |       to       |
  -----------------+----------------+----------------+
  kata-deploy      | "latest"       | "latest"       |
  -----------------+----------------+----------------+
  kata-deploy-base | "stable        | "stable"       |
  -----------------+----------------+----------------+

 2) [main] ------> [stable] Update kata-deploy and
   "alpha2"         "rc0"   get rid of kata-deploy-base

                   +----------------+----------------+
                   |      from      |       to       |
  -----------------+----------------+----------------+
  kata-deploy      | "latest"       | "rc0"          |
  -----------------+----------------+----------------+
  kata-deploy-base | "stable"       | REMOVED        |
  -----------------+----------------+----------------+

 3) [stable] ------> [stable]    Update kata-deploy
    "x.y.z"         "x.y.(z+1)"

                   +----------------+----------------+
                   |      from      |       to       |
  -----------------+----------------+----------------+
  kata-deploy      | "x.y.z"        | "x.y.(z+1)"    |
  -----------------+----------------+----------------+
  kata-deploy-base | NON-EXISTENT   | NON-EXISTENT   |
  -----------------+----------------+----------------+
```

And we can easily cover those 3 cases only with the information about
the "${target_branch}" and the "${new_version}", where:
* case 1) if "${target_branch}" is "main" *and* "${new_version}"
  contains "alpha", do nothing
* case 2) if "${target_branch}" is "main" *and* "${new_version}"
  contains "rc":
  * change the kata-deploy & kata-cleanup tags from "latest" to
    "${new_version}".
  * delete the kata-deploy-stable & kata-cleanup-stable files.
* case 3) if the "${target_branch}" contains "stable":
  * change the kata-deploy & kata-cleanup tags from "${current_version}"
    to "${new_version}".

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 43a72d76e2)
2021-09-23 14:04:44 +02:00
Fabiano Fidêncio
98e2e93552 kata-deploy: Add "stable" info to the README
Similar to the instructions we have for the "latest" images, let's also
add instructions about the "stable" images.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit ea9b2f9c92)
2021-09-23 14:04:38 +02:00
Fabiano Fidêncio
8f25c7da11 kata-deploy: Update the README
Let's just point to our repo URLs rather than assume users using
kata-deploy will have our repo cloned.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit e541105680)
2021-09-23 14:04:29 +02:00
Fabiano Fidêncio
84da2f8ddc workflows: Add "stable" & "latest" tags to kata-deploy
When releasing a tarball, let's *also* add the "stable" & "latest" tags
to the kata-deploy image.

The "stable" tag refers to any official release, while the "latest" tag
refers to any pre-release / release candidate.

Fixes: #2302

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit a156288c1f)
2021-09-23 14:01:33 +02:00
Fabiano Fidêncio
de0e3915b7 Merge pull request #2702 from Jakob-Naucke/backport-qemu-gitlab
packaging: Backport QEMU's GitLab switch to 5.1.x
2021-09-23 12:59:17 +02:00
Jakob Naucke
5c76f1c65a packaging: Backport QEMU's GitLab switch to 5.1.x
This brings #2699 to 5.1.x for ARM. Add a `no_patches.txt` for 5.1.0
which was missing apparently.

Fixes: #2701
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-09-23 11:11:45 +02:00
Fabiano Fidêncio
522a53010c Merge pull request #2690 from fidencio/wip/stable-2.2-upload-cargo-vendored-tarball
stable-2.2 | workflows,release: Upload the vendored cargo code
2021-09-22 22:07:08 +02:00
Julio Montes
852fc53351 Merge pull request #2688 from GabyCT/shutdown
backport: Call agent shutdown test only in the correspondent CI_JOB
2021-09-22 09:53:14 -05:00
Julio Montes
e0a27b5e90 Merge pull request #2699 from Jakob-Naucke/backport-qemu-gitlab
packaging: Backport QEMU's switch to GitLab repos
2021-09-22 09:19:16 -05:00
Jakob Naucke
ba6fc32804 packaging: Backport QEMU's switch to GitLab repos
QEMU's submodule checkout from git.qemu.org can fail. On QEMU 6.x, this
is not a problem because they moved to GitLab. However, we use QEMU 5.2
on stable-2.2, which can be a problem when no cached QEMU is used.
Backport QEMU's switch.

Fixes: #2698
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-09-22 14:59:35 +02:00
Fabiano Fidêncio
d5f5da4323 workflows,release: Upload the vendored cargo code
As part of the release, let's also upload a tarball with the vendored
cargo code.  By doing this we allow distros, which usually don't have
access to the internet while performing the builds, to just add the
vendored code as a second source, making the life of the downstream
maintainers slightly easier*.

Fixes: #1203
Backports: #2573

*: The current workflow requires the downstream maintainer to download
the tarball, unpack it, run `cargo vendor`, create the tarball, etc.
Although this doesn't look like a ridiculous amount of work, it's better
if we can have it in an automated fashion.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 21c8511630)
2021-09-21 21:48:58 +02:00
Gabriela Cervantes
017cd3c53c ci: Call agent shutdown test only in the correspondent CI_JOB
The agent shutdown test should only run on the CI JOB of CRI_CONTAINERD_K8S_MINIMAL
which is the only one where testing tracing is being enabled, however, this
test is being triggered in multiple CI jobs where it should not run. This PR
fixes that issue.

Fixes #2683

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-09-21 17:01:09 +00:00
Chelsea Mafrica
484af1a559 Merge pull request #2678 from nubificus/stable-2.2-fix_fc_vcpu_thread
stable-2.2 | virtcontainers: fc: parse vcpuID correctly
2021-09-20 09:46:07 -07:00
Chelsea Mafrica
a572a6ebf8 Merge pull request #2679 from c3d/backport/2527-adding-debugging-msgs
shimv2: Backport fixes for #2527
2021-09-20 09:42:53 -07:00
Snir Sheriber
2ca867da7b runtime: Add container field to logs
and unified field naming

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>

Backport from commit 0c7789fad6
Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2021-09-20 11:04:09 +02:00
Snir Sheriber
f4da502c4f shimv2: add information to method comment
add a comment to explicitly mentioned method is a binary call

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>

Backport from commit 72e3538e36
Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2021-09-20 11:03:45 +02:00
Snir Sheriber
16164241df shimv2: add logging to shimv2 api calls
and also fetch and log container id from the request

Fixes: #2527
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>

Backport from commit 8dadca9cd1
Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2021-09-20 11:02:35 +02:00
Christophe de Dinechin
25c7e1181a virtiofs: Create shared directory with 0700 mode, not 0750
A discussion on the Linux kernel mailing list [1] exposed that virtiofsd makes a
core assumption that the file systems being shared are not accessible by any
non-privileged user. We currently create the `shared` directory in the sandbox
with the default `0750` permissions, which gives read and directory traversal
access to the group. There is no real good reason for a non-root user to access
the shared directory, and this is potentially dangerous.

Fixes: #2589

[1]: https://lore.kernel.org/linux-fsdevel/YTI+k29AoeGdX13Q@redhat.com/

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2021-09-20 10:54:18 +02:00
Anastassios Nanos
4c5bf0576b virtcontainers: fc: parse vcpuID correctly
In getThreadIDs(), the cpuID variable is derived from a string that
already contains a whitespace. As a result, strings.SplitAfter returns
the cpuID with a leading space. This makes any go variant of string to int
fail (strconv.ParseInt() in our case). This patch makes sure that the
leading space character is removed so the string passed to
strconv.ParseInt() is "CPUID" and not " CPUID".

This has been caused by a change in the naming scheme of vcpu threads
for Firecracker after v0.19.1.

Fixes: #2592

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
2021-09-18 08:10:13 +00:00
Chelsea Mafrica
b3e620dbcf runtime: tracing: Fix logger passed in newContainer
Change logger in Trace call in newContainer from sandbox.Logger() to
nil. Passing nil will cause an error to be logged by kataTraceLogger
instead of the sandbox logger, which will avoid having the log message
report it as part of the sandbox subsystem when it is part of the
container subsystem.

The kataTraceLogger will not log it as related to the container
subsystem, but since the container logger has not been created at this
point, and we already use the kataTraceLogger in other instances where a
subsystem's logger has not been created yet, this PR makes the call
consistent with other code.

Backport of #2666
Fixes #2667

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-09-16 16:30:29 -07:00
Chelsea Mafrica
98c2ca13c1 runtime: tracing: Use root context to stop tracing
Call StopTracing with s.rootCtx, which is the root context for tracing,
instead of s.ctx, which is parent to a subset of trace spans.

Backport of #2662

Fixes #2663

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-09-16 11:19:40 -07:00
Fabiano Fidêncio
a97c9063db Merge pull request #2642 from jongwu/qemu_mak_2.2
backport-2.2: remove default config for arm64.
2021-09-16 07:21:32 +02:00
Jianyong Wu
0481c5070c backport-2.2: remove default config for arm64.
The current default config in qemu for arm64 doesn't suit for qemu
version 5.1+, so remove them here.

Fixes: #2595
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2021-09-15 10:07:13 +08:00
Samuel Ortiz
64504061c8 Merge pull request #2619 from likebreath/0913/backport_clh_v18.0
stable-2.2 | versions: Upgrade to Cloud Hypervisor v18.0
2021-09-14 12:02:50 +02:00
Binbin Zhang
56920bc943 sandbox: Allow the device to be accessed,such as /dev/null and /dev/urandom
If the device has no permission, such as /dev/null, /dev/urandom,
it needs to be added into cgroup.

Fixes: #2615
Backport: #2616

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2021-09-14 10:33:49 +08:00
Bo Chen
a1874ccd62 virtcontainers: clh: Revert the workaround incorrect default values
Given the fix to the bugs of the openapi spec file is included in the
Cloud Hypervisor v18.0 [1], this patch reverts the workaround we carried
in the CLH driver.

This reverts commit 932ee41b3f.

[1] https://github.com/cloud-hypervisor/cloud-hypervisor/pull/3029

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit f785ff0bf2)
2021-09-13 14:17:58 -07:00
Bo Chen
c2c650500b virtcontainers: clh: Re-generate the client code
This patch re-generates the client code for Cloud Hypervisor v18.0.
Note: The client code of cloud-hypervisor's (CLH) OpenAPI is
automatically generated by openapi-generator [1-2].

[1] https://github.com/OpenAPITools/openapi-generator
[2] https://github.com/kata-containers/kata-containers/blob/main/src/runtime/virtcontainers/pkg/cloud-hypervisor/README.md

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit 0e0e59dc5f)
2021-09-13 14:17:58 -07:00
Bo Chen
7ee43f9468 versions: Upgrade to Cloud Hypervisor v18.0
Highlights from the Cloud Hypervisor release v18.0: 1) Experimental User
Device (vfio-user) support; 2) Migration support for vhost-user devices;
3) VHDX disk image support; 4) Device pass through on MSHV hypervisor;
5) AArch64 for support virtio-mem; 6) Live migration on MSHV hypervisor;
7) AArch64 CPU topology support; 8) Power button support on AArch64; 9)
Various bug fixes on PTY, TTY, signal handling, and live-migration on
AArch64.

Details can be found: https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v18.0

Fixes: #2543

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit f0b5331430)
2021-09-13 14:17:58 -07:00
Samuel Ortiz
eedf139076 Merge pull request #2608 from Bevisy/main-2539-bp
[backport]sandbox: Add device permissions such as /dev/null to cgroup
2021-09-13 19:07:17 +02:00
Fabiano Fidêncio
54a6890c3c Merge pull request #2614 from sameo/stable-2.2
[backport] runtime: Fix README link
2021-09-13 17:45:07 +02:00
Samuel Ortiz
1792a9fe11 runtime: Fix README link
The LICENSE file lives in the project's root.

Fixes #2612

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2021-09-11 09:57:49 +02:00
Julio Montes
9bf95279be Merge pull request #2588 from devimc/2021-09-07/backport/fixSnap
[backport] snap: Test variable instead of executing "branch"
2021-09-10 14:44:55 -05:00
Binbin Zhang
807cc8a3a5 sandbox: Add device permissions such as /dev/null to cgroup
adds the default devices for unix such as /dev/null, /dev/urandom to
the container's resource cgroup spec

Fixes: #2539
Backports: #2603

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2021-09-10 17:33:26 +08:00
David Gibson
5987f3b5e1 snap: Test variable instead of executing "branch"
In snapcraft.yaml we have a case statement on $(branch) - that is on the
output of executing a command "branch".  From the selections it appears
that what it actually wants is to simply select on the contents of the
$branch variable, which should be ${branch} instead.

fixes #2558

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-09-07 09:37:17 -05:00
Fabiano Fidêncio
caafd0f952 Merge pull request #2541 from fidencio/2.2.0-branch-bump
# Kata Containers 2.2.0
2021-09-01 00:33:25 +02:00
Fabiano Fidêncio
800126b272 release: Kata Containers 2.2.0
- runtime: drop qemu-lite support
- stable-2.2 | virtcontainers: clh: Upgrade to the openapi-generator v5.2.1
- backport ci: Temporarily skip agent shutdown test on s390x
- backport: build_image: Fix error soft link about initrd.img

dca35c17 docs: remove mentioning of qemu-lite
0bdfdad2 runtime: drop qemu-lite support
60155756 runtime: fix default hypervisor path
ca9e6538 ci: Temporarily skip agent shutdown test on s390x
938b01ae virtcontainers: clh: Workaround incorrect default values
abd708e8 virtcontainers: clh: Fix the unit test
61babd45 virtcontainers: clh: Use constructors to ensure proper default value
59c51f62 virtcontainers: clh: Migrate to use the updated client APIs
c1f260cc virtcontainers: clh: Re-generate the client code
4cd6909f virtcontainers: clh: Upgrade to the openapi-generator v5.2.1
efa2d54e build_image: Fix error soft link about initrd.img

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-08-31 18:44:03 +02:00
Archana Shinde
b1372b353f Merge pull request #2533 from bergwolf/qemu-lite
runtime: drop qemu-lite support
2021-08-31 07:39:24 -07:00
Peng Tao
dca35c1730 docs: remove mentioning of qemu-lite
vm-templating should just work with upstream qemu v4.1.0 or above.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-08-31 10:17:12 +08:00
Peng Tao
0bdfdad236 runtime: drop qemu-lite support
As the project is not maintained and we have not been testing against it
for a long time.

Fixes: #2529
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-08-31 10:17:06 +08:00
Peng Tao
60155756f3 runtime: fix default hypervisor path
Should not be qemu-lite.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-08-31 10:16:57 +08:00
Fabiano Fidêncio
669888c339 Merge pull request #2525 from likebreath/0827/backport_clh_generator
stable-2.2 | virtcontainers: clh: Upgrade to the openapi-generator v5.2.1
2021-08-30 21:25:05 +02:00
GabyCT
cde008f441 Merge pull request #2531 from Jakob-Naucke/backport-s390x-skip-agent-shutdown-test
backport ci: Temporarily skip agent shutdown test on s390x
2021-08-30 09:25:50 -05:00
Peng Tao
7c866073f9 Merge pull request #2520 from Bevisy/stable-2.2-2503
backport: build_image: Fix error soft link about initrd.img
2021-08-30 20:16:55 +08:00
Jakob Naucke
ca9e6538e6 ci: Temporarily skip agent shutdown test on s390x
see https://github.com/kata-containers/tests/issues/3878 for tracking

Fixes: #2507
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-08-30 14:14:43 +02:00
Bo Chen
938b01aedc virtcontainers: clh: Workaround incorrect default values
Two default values defined in the 'cloud-hypervisor.yaml' have typo, and this
patch manually overwrites them with the correct value as a workaround
before the corresponding fix is landed to Cloud Hypervisor upstream.

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit 932ee41b3f)
2021-08-27 13:37:47 -07:00
Bo Chen
abd708e814 virtcontainers: clh: Fix the unit test
This patch fixes the unit tests over clh.go with the updated client code.

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit bff38e4f4d)
2021-08-27 13:37:47 -07:00
Bo Chen
61babd45ed virtcontainers: clh: Use constructors to ensure proper default value
With the updated openapi-generator, the client code now handles optional
attributes correctly, and ensures to assign the right default
values. This patch enables to use those constructors to make sure the
proper default values being used.

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit d967d3cb37)
2021-08-27 13:37:47 -07:00
Bo Chen
59c51f6201 virtcontainers: clh: Migrate to use the updated client APIs
The client code (and APIs) for Cloud Hypervisor has been changed
dramatically due to the upgrade to `openapi-generator` v5.2.1. This
patch migrate the Cloud Hypervisor driver in the kata-runtime to use
those updated APIs.

The main change from the client code is that it now uses "pointer" type
to represent "optional" attributes from the input openapi specification
file.

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit a6a2e525de)
2021-08-27 13:37:47 -07:00
Bo Chen
c1f260cc40 virtcontainers: clh: Re-generate the client code
This patch re-generates the client code for Cloud Hypervisor with the
updated `openapi-generator` v5.2.1.

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit 46eb07e14f)
2021-08-27 13:37:47 -07:00
Bo Chen
4cd6909f18 virtcontainers: clh: Upgrade to the openapi-generator v5.2.1
To improve the quality and correctness of the auto-generated code, this
patch upgrade the `openapi-generator` to its latest stable release
v5.2.1.

Fixes: #2487

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit 80fba4d637)
2021-08-27 13:37:47 -07:00
Binbin Zhang
efa2d54e85 build_image: Fix error soft link about initrd.img
fix error soft link about initrd.img

Fixes #2503

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2021-08-27 16:15:49 +08:00
111 changed files with 14099 additions and 1519 deletions

View File

@@ -100,10 +100,14 @@ jobs:
run: |
# tag the container image we created and push to DockerHub
tag=$(echo $GITHUB_REF | cut -d/ -f3-)
docker tag katadocker/kata-deploy-ci:${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}} katadocker/kata-deploy:${tag}
docker tag quay.io/kata-containers/kata-deploy-ci:${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}} quay.io/kata-containers/kata-deploy:${tag}
docker push katadocker/kata-deploy:${tag}
docker push quay.io/kata-containers/kata-deploy:${tag}
tags=($tag)
tags+=($([[ "$tag" =~ "alpha"|"rc" ]] && echo "latest" || echo "stable"))
for tag in ${tags[@]}; do \
docker tag katadocker/kata-deploy-ci:${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}} katadocker/kata-deploy:${tag} && \
docker tag quay.io/kata-containers/kata-deploy-ci:${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}} quay.io/kata-containers/kata-deploy:${tag} && \
docker push katadocker/kata-deploy:${tag} && \
docker push quay.io/kata-containers/kata-deploy:${tag}; \
done
upload-static-tarball:
needs: kata-deploy
@@ -127,3 +131,21 @@ jobs:
pushd $GITHUB_WORKSPACE
echo "uploading asset '${tarball}' for tag: ${tag}"
GITHUB_TOKEN=${{ secrets.GIT_UPLOAD_TOKEN }} hub release edit -m "" -a "${tarball}" "${tag}"
popd
upload-cargo-vendored-tarball:
needs: upload-static-tarball
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: generate-and-upload-tarball
run: |
pushd $GITHUB_WORKSPACE/src/agent
cargo vendor >> .cargo/config
popd
tag=$(echo $GITHUB_REF | cut -d/ -f3-)
tarball="kata-containers-$tag-vendor.tar.gz"
pushd $GITHUB_WORKSPACE
tar -cvzf "${tarball}" src/agent/.cargo/config src/agent/vendor
GITHUB_TOKEN=${{ secrets.GIT_UPLOAD_TOKEN }} hub release edit -m "" -a "${tarball}" "${tag}"
popd

View File

@@ -1 +1 @@
2.2.0-rc0
2.2.1

View File

@@ -8,10 +8,14 @@
set -e
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
export CI_JOB="${CI_JOB:-}"
clone_tests_repo
pushd ${tests_repo_dir}
.ci/run.sh
tracing/test-agent-shutdown.sh
# temporary fix, see https://github.com/kata-containers/tests/issues/3878
if [ "$(uname -m)" != "s390x" ] && [ "$CI_JOB" == "CRI_CONTAINERD_K8S_MINIMAL" ]; then
tracing/test-agent-shutdown.sh
fi
popd

View File

@@ -47,7 +47,7 @@ and can be classified as potentially misunderstood behaviors rather than vulnera
VM templating can be enabled by changing your Kata Containers config file (`/usr/share/defaults/kata-containers/configuration.toml`,
overridden by `/etc/kata-containers/configuration.toml` if provided) such that:
- `qemu-lite` is specified in `hypervisor.qemu`->`path` section
- `qemu` version `v4.1.0` or above is specified in `hypervisor.qemu`->`path` section
- `enable_template = true`
- `initrd =` is set
- `image =` option is commented out or removed

View File

@@ -299,7 +299,7 @@ parts:
| xargs ./configure
# Copy QEMU configurations (Kconfigs)
case "$(branch)" in
case "${branch}" in
"v5.1.0")
cp -a ${kata_dir}/tools/packaging/qemu/default-configs/* default-configs
;;

View File

@@ -269,6 +269,19 @@ impl SandboxStorages {
let entry = Storage::new(storage)
.await
.with_context(|| "Failed to add storage")?;
// If the storage source is a directory, let's create the target mount point:
if entry.source_mount_point.as_path().is_dir() {
fs::create_dir_all(&entry.target_mount_point)
.await
.with_context(|| {
format!(
"Unable to mkdir all for {}",
entry.target_mount_point.display()
)
})?;
}
self.0.push(entry);
}
@@ -475,6 +488,85 @@ mod tests {
Ok((storage, src_path))
}
#[tokio::test]
async fn test_empty_sourcedir_check() {
//skip_if_not_root!();
let dir = tempfile::tempdir().expect("failed to create tempdir");
let logger = slog::Logger::root(slog::Discard, o!());
let src_path = dir.path().join("src");
let dest_path = dir.path().join("dest");
let src_filename = src_path.to_str().expect("failed to create src filename");
let dest_filename = dest_path.to_str().expect("failed to create dest filename");
std::fs::create_dir_all(src_filename).expect("failed to create path");
let storage = protos::Storage {
source: src_filename.to_string(),
mount_point: dest_filename.to_string(),
..Default::default()
};
let mut entries = SandboxStorages {
..Default::default()
};
entries
.add(std::iter::once(storage), &logger)
.await
.unwrap();
assert!(entries.check(&logger).await.is_ok());
assert_eq!(entries.0.len(), 1);
assert_eq!(std::fs::read_dir(src_path).unwrap().count(), 0);
assert_eq!(std::fs::read_dir(dest_path).unwrap().count(), 0);
assert_eq!(std::fs::read_dir(dir.path()).unwrap().count(), 2);
}
#[tokio::test]
async fn test_single_file_check() {
//skip_if_not_root!();
let dir = tempfile::tempdir().expect("failed to create tempdir");
let logger = slog::Logger::root(slog::Discard, o!());
let src_file_path = dir.path().join("src.txt");
let dest_file_path = dir.path().join("dest.txt");
let src_filename = src_file_path
.to_str()
.expect("failed to create src filename");
let dest_filename = dest_file_path
.to_str()
.expect("failed to create dest filename");
let storage = protos::Storage {
source: src_filename.to_string(),
mount_point: dest_filename.to_string(),
..Default::default()
};
//create file
fs::write(src_file_path, "original").unwrap();
let mut entries = SandboxStorages::default();
entries
.add(std::iter::once(storage), &logger)
.await
.unwrap();
assert!(entries.check(&logger).await.is_ok());
assert_eq!(entries.0.len(), 1);
// there should only be 2 files
assert_eq!(std::fs::read_dir(dir.path()).unwrap().count(), 2);
assert_eq!(fs::read_to_string(dest_file_path).unwrap(), "original");
}
#[tokio::test]
async fn test_watch_entries() {
skip_if_not_root!();

View File

@@ -27,7 +27,7 @@ to work seamlessly with both Docker and Kubernetes respectively.
The code is licensed under an Apache 2.0 license.
See [the license file](LICENSE) for further details.
See [the license file](../../LICENSE) for further details.
## Platform support

View File

@@ -210,7 +210,7 @@ func newTestHypervisorConfig(dir string, create bool) (vc.HypervisorConfig, erro
KernelPath: kernelPath,
ImagePath: imagePath,
HypervisorPath: hypervisorPath,
HypervisorMachineType: "pc-lite",
HypervisorMachineType: "q35",
}, nil
}

View File

@@ -181,8 +181,8 @@ func newCommand(ctx context.Context, id, containerdBinary, containerdAddress str
return cmd, nil
}
// StartShim willl start a kata shimv2 daemon which will implemented the
// ShimV2 APIs such as create/start/update etc containers.
// StartShim is a binary call that starts a kata shimv2 service which will
// implement the ShimV2 APIs such as create/start/update etc containers.
func (s *service) StartShim(ctx context.Context, opts cdshim.StartOpts) (_ string, retErr error) {
bundlePath, err := os.Getwd()
if err != nil {
@@ -310,6 +310,7 @@ func getTopic(e interface{}) string {
return cdruntime.TaskUnknownTopic
}
// Cleanup is a binary call that cleans up resources used by the shim
func (s *service) Cleanup(ctx context.Context) (_ *taskAPI.DeleteResponse, err error) {
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "Cleanup", shimTracingTags)
defer span.End()
@@ -369,6 +370,8 @@ func (s *service) Cleanup(ctx context.Context) (_ *taskAPI.DeleteResponse, err e
// Create a new sandbox or container with the underlying OCI runtime
func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ *taskAPI.CreateTaskResponse, err error) {
shimLog.WithField("container", r.ID).Debug("Create() start")
defer shimLog.WithField("container", r.ID).Debug("Create() end")
start := time.Now()
defer func() {
err = toGRPC(err)
@@ -426,6 +429,8 @@ func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ *
// Start a process
func (s *service) Start(ctx context.Context, r *taskAPI.StartRequest) (_ *taskAPI.StartResponse, err error) {
shimLog.WithField("container", r.ID).Debug("Start() start")
defer shimLog.WithField("container", r.ID).Debug("Start() end")
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "Start", shimTracingTags)
defer span.End()
@@ -477,6 +482,8 @@ func (s *service) Start(ctx context.Context, r *taskAPI.StartRequest) (_ *taskAP
// Delete the initial process and container
func (s *service) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (_ *taskAPI.DeleteResponse, err error) {
shimLog.WithField("container", r.ID).Debug("Delete() start")
defer shimLog.WithField("container", r.ID).Debug("Delete() end")
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "Delete", shimTracingTags)
defer span.End()
@@ -529,6 +536,8 @@ func (s *service) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (_ *task
// Exec an additional process inside the container
func (s *service) Exec(ctx context.Context, r *taskAPI.ExecProcessRequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("Exec() start")
defer shimLog.WithField("container", r.ID).Debug("Exec() end")
span, _ := katatrace.Trace(s.rootCtx, shimLog, "Exec", shimTracingTags)
defer span.End()
@@ -567,6 +576,8 @@ func (s *service) Exec(ctx context.Context, r *taskAPI.ExecProcessRequest) (_ *p
// ResizePty of a process
func (s *service) ResizePty(ctx context.Context, r *taskAPI.ResizePtyRequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("ResizePty() start")
defer shimLog.WithField("container", r.ID).Debug("ResizePty() end")
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "ResizePty", shimTracingTags)
defer span.End()
@@ -606,6 +617,8 @@ func (s *service) ResizePty(ctx context.Context, r *taskAPI.ResizePtyRequest) (_
// State returns runtime state information for a process
func (s *service) State(ctx context.Context, r *taskAPI.StateRequest) (_ *taskAPI.StateResponse, err error) {
shimLog.WithField("container", r.ID).Debug("State() start")
defer shimLog.WithField("container", r.ID).Debug("State() end")
span, _ := katatrace.Trace(s.rootCtx, shimLog, "State", shimTracingTags)
defer span.End()
@@ -660,6 +673,8 @@ func (s *service) State(ctx context.Context, r *taskAPI.StateRequest) (_ *taskAP
// Pause the container
func (s *service) Pause(ctx context.Context, r *taskAPI.PauseRequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("Pause() start")
defer shimLog.WithField("container", r.ID).Debug("Pause() end")
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "Pause", shimTracingTags)
defer span.End()
@@ -699,6 +714,8 @@ func (s *service) Pause(ctx context.Context, r *taskAPI.PauseRequest) (_ *ptypes
// Resume the container
func (s *service) Resume(ctx context.Context, r *taskAPI.ResumeRequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("Resume() start")
defer shimLog.WithField("container", r.ID).Debug("Resume() end")
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "Resume", shimTracingTags)
defer span.End()
@@ -736,6 +753,8 @@ func (s *service) Resume(ctx context.Context, r *taskAPI.ResumeRequest) (_ *ptyp
// Kill a process with the provided signal
func (s *service) Kill(ctx context.Context, r *taskAPI.KillRequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("Kill() start")
defer shimLog.WithField("container", r.ID).Debug("Kill() end")
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "Kill", shimTracingTags)
defer span.End()
@@ -797,6 +816,8 @@ func (s *service) Kill(ctx context.Context, r *taskAPI.KillRequest) (_ *ptypes.E
// Since for kata, it cannot get the process's pid from VM,
// thus only return the Shim's pid directly.
func (s *service) Pids(ctx context.Context, r *taskAPI.PidsRequest) (_ *taskAPI.PidsResponse, err error) {
shimLog.WithField("container", r.ID).Debug("Pids() start")
defer shimLog.WithField("container", r.ID).Debug("Pids() end")
span, _ := katatrace.Trace(s.rootCtx, shimLog, "Pids", shimTracingTags)
defer span.End()
@@ -820,6 +841,8 @@ func (s *service) Pids(ctx context.Context, r *taskAPI.PidsRequest) (_ *taskAPI.
// CloseIO of a process
func (s *service) CloseIO(ctx context.Context, r *taskAPI.CloseIORequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("CloseIO() start")
defer shimLog.WithField("container", r.ID).Debug("CloseIO() end")
span, _ := katatrace.Trace(s.rootCtx, shimLog, "CloseIO", shimTracingTags)
defer span.End()
@@ -861,6 +884,8 @@ func (s *service) CloseIO(ctx context.Context, r *taskAPI.CloseIORequest) (_ *pt
// Checkpoint the container
func (s *service) Checkpoint(ctx context.Context, r *taskAPI.CheckpointTaskRequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("Checkpoint() start")
defer shimLog.WithField("container", r.ID).Debug("Checkpoint() end")
span, _ := katatrace.Trace(s.rootCtx, shimLog, "Checkpoint", shimTracingTags)
defer span.End()
@@ -875,6 +900,8 @@ func (s *service) Checkpoint(ctx context.Context, r *taskAPI.CheckpointTaskReque
// Connect returns shim information such as the shim's pid
func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (_ *taskAPI.ConnectResponse, err error) {
shimLog.WithField("container", r.ID).Debug("Connect() start")
defer shimLog.WithField("container", r.ID).Debug("Connect() end")
span, _ := katatrace.Trace(s.rootCtx, shimLog, "Connect", shimTracingTags)
defer span.End()
@@ -895,6 +922,8 @@ func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (_ *ta
}
func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("Shutdown() start")
defer shimLog.WithField("container", r.ID).Debug("Shutdown() end")
span, _ := katatrace.Trace(s.rootCtx, shimLog, "Shutdown", shimTracingTags)
start := time.Now()
@@ -911,7 +940,7 @@ func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (_ *
s.mu.Unlock()
span.End()
katatrace.StopTracing(s.ctx)
katatrace.StopTracing(s.rootCtx)
s.cancel()
@@ -928,6 +957,8 @@ func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (_ *
}
func (s *service) Stats(ctx context.Context, r *taskAPI.StatsRequest) (_ *taskAPI.StatsResponse, err error) {
shimLog.WithField("container", r.ID).Debug("Stats() start")
defer shimLog.WithField("container", r.ID).Debug("Stats() end")
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "Stats", shimTracingTags)
defer span.End()
@@ -957,6 +988,8 @@ func (s *service) Stats(ctx context.Context, r *taskAPI.StatsRequest) (_ *taskAP
// Update a running container
func (s *service) Update(ctx context.Context, r *taskAPI.UpdateTaskRequest) (_ *ptypes.Empty, err error) {
shimLog.WithField("container", r.ID).Debug("Update() start")
defer shimLog.WithField("container", r.ID).Debug("Update() end")
span, spanCtx := katatrace.Trace(s.rootCtx, shimLog, "Update", shimTracingTags)
defer span.End()
@@ -989,6 +1022,8 @@ func (s *service) Update(ctx context.Context, r *taskAPI.UpdateTaskRequest) (_ *
// Wait for a process to exit
func (s *service) Wait(ctx context.Context, r *taskAPI.WaitRequest) (_ *taskAPI.WaitResponse, err error) {
shimLog.WithField("container", r.ID).Debug("Wait() start")
defer shimLog.WithField("container", r.ID).Debug("Wait() end")
span, _ := katatrace.Trace(s.rootCtx, shimLog, "Wait", shimTracingTags)
defer span.End()

View File

@@ -192,7 +192,7 @@ func newTestHypervisorConfig(dir string, create bool) (vc.HypervisorConfig, erro
KernelPath: kernelPath,
ImagePath: imagePath,
HypervisorPath: hypervisorPath,
HypervisorMachineType: "pc-lite",
HypervisorMachineType: "q35",
}, nil
}

View File

@@ -8,7 +8,7 @@
package katautils
var defaultHypervisorPath = "/usr/bin/qemu-lite-system-x86_64"
var defaultHypervisorPath = "/usr/bin/qemu-system-x86_64"
var defaultHypervisorCtlPath = "/usr/bin/acrnctl"
var defaultJailerPath = "/usr/bin/jailer"
var defaultImagePath = "/usr/share/kata-containers/kata-containers.img"

View File

@@ -138,7 +138,7 @@ func newTestHypervisorConfig(dir string, create bool) (vc.HypervisorConfig, erro
KernelPath: kernelPath,
ImagePath: imagePath,
HypervisorPath: hypervisorPath,
HypervisorMachineType: "pc-lite",
HypervisorMachineType: "q35",
}, nil
}

View File

@@ -102,6 +102,47 @@ type clhClient interface {
VmRemoveDevicePut(ctx context.Context, vmRemoveDevice chclient.VmRemoveDevice) (*http.Response, error)
}
type clhClientApi struct {
ApiInternal *chclient.DefaultApiService
}
func (c *clhClientApi) VmmPingGet(ctx context.Context) (chclient.VmmPingResponse, *http.Response, error) {
return c.ApiInternal.VmmPingGet(ctx).Execute()
}
func (c *clhClientApi) ShutdownVMM(ctx context.Context) (*http.Response, error) {
return c.ApiInternal.ShutdownVMM(ctx).Execute()
}
func (c *clhClientApi) CreateVM(ctx context.Context, vmConfig chclient.VmConfig) (*http.Response, error) {
return c.ApiInternal.CreateVM(ctx).VmConfig(vmConfig).Execute()
}
//nolint:golint
func (c *clhClientApi) VmInfoGet(ctx context.Context) (chclient.VmInfo, *http.Response, error) {
return c.ApiInternal.VmInfoGet(ctx).Execute()
}
func (c *clhClientApi) BootVM(ctx context.Context) (*http.Response, error) {
return c.ApiInternal.BootVM(ctx).Execute()
}
func (c *clhClientApi) VmResizePut(ctx context.Context, vmResize chclient.VmResize) (*http.Response, error) {
return c.ApiInternal.VmResizePut(ctx).VmResize(vmResize).Execute()
}
func (c *clhClientApi) VmAddDevicePut(ctx context.Context, vmAddDevice chclient.VmAddDevice) (chclient.PciDeviceInfo, *http.Response, error) {
return c.ApiInternal.VmAddDevicePut(ctx).VmAddDevice(vmAddDevice).Execute()
}
func (c *clhClientApi) VmAddDiskPut(ctx context.Context, diskConfig chclient.DiskConfig) (chclient.PciDeviceInfo, *http.Response, error) {
return c.ApiInternal.VmAddDiskPut(ctx).DiskConfig(diskConfig).Execute()
}
func (c *clhClientApi) VmRemoveDevicePut(ctx context.Context, vmRemoveDevice chclient.VmRemoveDevice) (*http.Response, error) {
return c.ApiInternal.VmRemoveDevicePut(ctx).VmRemoveDevice(vmRemoveDevice).Execute()
}
//
// Cloud hypervisor state
//
@@ -190,33 +231,26 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
// to fetch if this is the first time the hypervisor is created.
clh.Logger().WithField("function", "createSandbox").Info("Sandbox not found creating")
// Set initial memomory size of the virtual machine
// Convert to int64 openApiClient only support int64
clh.vmconfig.Memory.Size = int64((utils.MemUnit(clh.config.MemorySize) * utils.MiB).ToBytes())
// shared memory should be enabled if using vhost-user(kata uses virtiofsd)
clh.vmconfig.Memory.Shared = true
hostMemKb, err := getHostMemorySizeKb(procMemInfo)
if err != nil {
return nil
}
// OpenAPI only supports int64 values
clh.vmconfig.Memory.HotplugSize = int64((utils.MemUnit(hostMemKb) * utils.KiB).ToBytes())
// Set initial amount of cpu's for the virtual machine
clh.vmconfig.Cpus = chclient.CpusConfig{
// cast to int32, as openAPI has a limitation that it does not support unsigned values
BootVcpus: int32(clh.config.NumVCPUs),
MaxVcpus: int32(clh.config.DefaultMaxVCPUs),
}
// Add the kernel path
// Make sure the kernel path is valid
kernelPath, err := clh.config.KernelAssetPath()
if err != nil {
return err
}
clh.vmconfig.Kernel = chclient.KernelConfig{
Path: kernelPath,
// Create the VM config via the constructor to ensure default values are properly assigned
clh.vmconfig = *chclient.NewVmConfig(*chclient.NewKernelConfig(kernelPath))
// Create the VM memory config via the constructor to ensure default values are properly assigned
clh.vmconfig.Memory = chclient.NewMemoryConfig(int64((utils.MemUnit(clh.config.MemorySize) * utils.MiB).ToBytes()))
// shared memory should be enabled if using vhost-user(kata uses virtiofsd)
clh.vmconfig.Memory.Shared = func(b bool) *bool { return &b }(true)
hostMemKb, err := getHostMemorySizeKb(procMemInfo)
if err != nil {
return nil
}
// OpenAPI only supports int64 values
clh.vmconfig.Memory.HotplugSize = func(i int64) *int64 { return &i }(int64((utils.MemUnit(hostMemKb) * utils.KiB).ToBytes()))
// Set initial amount of cpu's for the virtual machine
clh.vmconfig.Cpus = chclient.NewCpusConfig(int32(clh.config.NumVCPUs), int32(clh.config.DefaultMaxVCPUs))
// First take the default parameters defined by this driver
params := clhKernelParams
@@ -229,12 +263,10 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
// Followed by extra kernel parameters defined in the configuration file
params = append(params, clh.config.KernelParams...)
clh.vmconfig.Cmdline.Args = kernelParamsToString(params)
clh.vmconfig.Cmdline = chclient.NewCmdLineConfig(kernelParamsToString(params))
// set random device generator to hypervisor
clh.vmconfig.Rng = chclient.RngConfig{
Src: clh.config.EntropySource,
}
clh.vmconfig.Rng = chclient.NewRngConfig(clh.config.EntropySource)
// set the initial root/boot disk of hypervisor
imagePath, err := clh.config.ImageAssetPath()
@@ -246,33 +278,30 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
return errors.New("image path is empty")
}
pmem := chclient.PmemConfig{
File: imagePath,
DiscardWrites: true,
pmem := chclient.NewPmemConfig(imagePath)
*pmem.DiscardWrites = true
if clh.vmconfig.Pmem != nil {
*clh.vmconfig.Pmem = append(*clh.vmconfig.Pmem, *pmem)
} else {
clh.vmconfig.Pmem = &[]chclient.PmemConfig{*pmem}
}
clh.vmconfig.Pmem = append(clh.vmconfig.Pmem, pmem)
// set the serial console to the cloud hypervisor
if clh.config.Debug {
clh.vmconfig.Serial = chclient.ConsoleConfig{
Mode: cctTTY,
}
clh.vmconfig.Serial = chclient.NewConsoleConfig(cctTTY)
} else {
clh.vmconfig.Serial = chclient.ConsoleConfig{
Mode: cctNULL,
}
clh.vmconfig.Serial = chclient.NewConsoleConfig(cctNULL)
}
clh.vmconfig.Console = chclient.ConsoleConfig{
Mode: cctOFF,
}
clh.vmconfig.Console = chclient.NewConsoleConfig(cctOFF)
cpu_topology := chclient.NewCpuTopology()
cpu_topology.ThreadsPerCore = func(i int32) *int32 { return &i }(1)
cpu_topology.CoresPerDie = func(i int32) *int32 { return &i }(int32(clh.config.DefaultMaxVCPUs))
cpu_topology.DiesPerPackage = func(i int32) *int32 { return &i }(1)
cpu_topology.Packages = func(i int32) *int32 { return &i }(1)
clh.vmconfig.Cpus.Topology = cpu_topology
clh.vmconfig.Cpus.Topology = chclient.CpuTopology{
ThreadsPerCore: 1,
CoresPerDie: int32(clh.config.DefaultMaxVCPUs),
DiesPerPackage: 1,
Packages: 1,
}
// Overwrite the default value of HTTP API socket path for cloud hypervisor
apiSocketPath, err := clh.apiSocketPath(id)
if err != nil {
@@ -295,7 +324,9 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
},
}
clh.APIClient = chclient.NewAPIClient(cfg).DefaultApi
clh.APIClient = &clhClientApi{
ApiInternal: chclient.NewAPIClient(cfg).DefaultApi,
}
clh.virtiofsd = &virtiofsd{
path: clh.config.VirtioFSDaemon,
@@ -307,12 +338,15 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
}
if clh.config.SGXEPCSize > 0 {
epcSection := chclient.SgxEpcConfig{
Size: clh.config.SGXEPCSize,
Prefault: true,
epcSection := chclient.NewSgxEpcConfig("kata-epc", clh.config.SGXEPCSize)
epcSection.Prefault = func(b bool) *bool { return &b }(true)
if clh.vmconfig.SgxEpc != nil {
*clh.vmconfig.SgxEpc = append(*clh.vmconfig.SgxEpc, *epcSection)
} else {
clh.vmconfig.SgxEpc = &[]chclient.SgxEpcConfig{*epcSection}
}
clh.vmconfig.SgxEpc = append(clh.vmconfig.SgxEpc, epcSection)
}
return nil
@@ -453,13 +487,13 @@ func (clh *cloudHypervisor) hotplugAddBlockDevice(drive *config.BlockDrive) erro
return fmt.Errorf("pmem device hotplug not supported")
}
blkDevice := chclient.DiskConfig{
Path: drive.File,
Readonly: drive.ReadOnly,
VhostUser: false,
Id: driveID,
}
pciInfo, _, err := cl.VmAddDiskPut(ctx, blkDevice)
// Create the clh disk config via the constructor to ensure default values are properly assigned
clhDisk := *chclient.NewDiskConfig(drive.File)
clhDisk.Readonly = &drive.ReadOnly
clhDisk.VhostUser = func(b bool) *bool { return &b }(false)
clhDisk.Id = &driveID
pciInfo, _, err := cl.VmAddDiskPut(ctx, clhDisk)
if err != nil {
return fmt.Errorf("failed to hotplug block device %+v %s", drive, openAPIClientError(err))
@@ -475,7 +509,11 @@ func (clh *cloudHypervisor) hotPlugVFIODevice(device config.VFIODev) error {
ctx, cancel := context.WithTimeout(context.Background(), clhHotPlugAPITimeout*time.Second)
defer cancel()
_, _, err := cl.VmAddDevicePut(ctx, chclient.VmAddDevice{Path: device.SysfsDev, Id: device.ID})
// Create the clh device config via the constructor to ensure default values are properly assigned
clhDevice := *chclient.NewVmAddDevice()
clhDevice.Path = &device.SysfsDev
clhDevice.Id = &device.ID
_, _, err := cl.VmAddDevicePut(ctx, clhDevice)
if err != nil {
err = fmt.Errorf("Failed to hotplug device %+v %s", device, openAPIClientError(err))
}
@@ -521,7 +559,9 @@ func (clh *cloudHypervisor) hotplugRemoveDevice(ctx context.Context, devInfo int
ctx, cancel := context.WithTimeout(context.Background(), clhHotPlugAPITimeout*time.Second)
defer cancel()
_, err := cl.VmRemoveDevicePut(ctx, chclient.VmRemoveDevice{Id: deviceID})
remove := *chclient.NewVmRemoveDevice()
remove.Id = &deviceID
_, err := cl.VmRemoveDevicePut(ctx, remove)
if err != nil {
err = fmt.Errorf("failed to hotplug remove (unplug) device %+v: %s", devInfo, openAPIClientError(err))
}
@@ -586,8 +626,9 @@ func (clh *cloudHypervisor) resizeMemory(ctx context.Context, reqMemMB uint32, m
ctx, cancelResize := context.WithTimeout(ctx, clhAPITimeout*time.Second)
defer cancelResize()
resize := *chclient.NewVmResize()
// OpenApi does not support uint64, convert to int64
resize := chclient.VmResize{DesiredRam: int64(newMem.ToBytes())}
resize.DesiredRam = func(i int64) *int64 { return &i }(int64(newMem.ToBytes()))
clh.Logger().WithFields(log.Fields{"current-memory": currentMem, "new-memory": newMem}).Debug("updating VM memory")
if _, err = cl.VmResizePut(ctx, resize); err != nil {
clh.Logger().WithError(err).WithFields(log.Fields{"current-memory": currentMem, "new-memory": newMem}).Warnf("failed to update memory %s", openAPIClientError(err))
@@ -629,7 +670,9 @@ func (clh *cloudHypervisor) resizeVCPUs(ctx context.Context, reqVCPUs uint32) (c
// Resize (hot-plug) vCPUs via HTTP API
ctx, cancel := context.WithTimeout(ctx, clhAPITimeout*time.Second)
defer cancel()
if _, err = cl.VmResizePut(ctx, chclient.VmResize{DesiredVcpus: int32(reqVCPUs)}); err != nil {
resize := *chclient.NewVmResize()
resize.DesiredVcpus = func(i int32) *int32 { return &i }(int32(reqVCPUs))
if _, err = cl.VmResizePut(ctx, resize); err != nil {
return currentVCPUs, newVCPUs, errors.Wrap(err, "[clh] VmResizePut failed")
}
@@ -1054,7 +1097,7 @@ func (clh *cloudHypervisor) addVSock(cid int64, path string) {
"cid": cid,
}).Info("Adding HybridVSock")
clh.vmconfig.Vsock = chclient.VsockConfig{Cid: cid, Socket: path}
clh.vmconfig.Vsock = chclient.NewVsockConfig(cid, path)
}
func (clh *cloudHypervisor) addNet(e Endpoint) error {
@@ -1076,7 +1119,15 @@ func (clh *cloudHypervisor) addNet(e Endpoint) error {
"tap": tapPath,
}).Info("Adding Net")
clh.vmconfig.Net = append(clh.vmconfig.Net, chclient.NetConfig{Mac: mac, Tap: tapPath})
net := chclient.NewNetConfig()
net.Mac = &mac
net.Tap = &tapPath
if clh.vmconfig.Net != nil {
*clh.vmconfig.Net = append(*clh.vmconfig.Net, *net)
} else {
clh.vmconfig.Net = &[]chclient.NetConfig{*net}
}
return nil
}
@@ -1099,16 +1150,8 @@ func (clh *cloudHypervisor) addVolume(volume types.Volume) error {
numQueues := int32(1)
queueSize := int32(1024)
clh.vmconfig.Fs = []chclient.FsConfig{
{
Tag: volume.MountTag,
Socket: vfsdSockPath,
Dax: dax,
CacheSize: int64(clh.config.VirtioFSCacheSize << 20),
NumQueues: numQueues,
QueueSize: queueSize,
},
}
fs := chclient.NewFsConfig(volume.MountTag, vfsdSockPath, numQueues, queueSize, dax, int64(clh.config.VirtioFSCacheSize<<20))
clh.vmconfig.Fs = &[]chclient.FsConfig{*fs}
clh.Logger().Debug("Adding share volume to hypervisor: ", volume.MountTag)
return nil

View File

@@ -134,19 +134,19 @@ func TestCloudHypervisorAddNetCheckNetConfigListValues(t *testing.T) {
err := clh.addNet(e)
assert.Nil(err)
assert.Equal(len(clh.vmconfig.Net), 1)
assert.Equal(len(*clh.vmconfig.Net), 1)
if err == nil {
assert.Equal(clh.vmconfig.Net[0].Mac, macTest)
assert.Equal(clh.vmconfig.Net[0].Tap, tapPath)
assert.Equal(*(*clh.vmconfig.Net)[0].Mac, macTest)
assert.Equal(*(*clh.vmconfig.Net)[0].Tap, tapPath)
}
err = clh.addNet(e)
assert.Nil(err)
assert.Equal(len(clh.vmconfig.Net), 2)
assert.Equal(len(*clh.vmconfig.Net), 2)
if err == nil {
assert.Equal(clh.vmconfig.Net[1].Mac, macTest)
assert.Equal(clh.vmconfig.Net[1].Tap, tapPath)
assert.Equal(*(*clh.vmconfig.Net)[1].Mac, macTest)
assert.Equal(*(*clh.vmconfig.Net)[1].Tap, tapPath)
}
}
@@ -180,7 +180,7 @@ func TestCloudHypervisorAddNetCheckEnpointTypes(t *testing.T) {
t.Errorf("cloudHypervisor.addNet() error = %v, wantErr %v", err, tt.wantErr)
} else if err == nil {
assert.Equal(clh.vmconfig.Net[0].Tap, tapPath)
assert.Equal(*(*clh.vmconfig.Net)[0].Tap, tapPath)
}
})
}
@@ -294,8 +294,9 @@ func TestCloudHypervisorResizeMemory(t *testing.T) {
clh := cloudHypervisor{}
mockClient := &clhClientMock{}
mockClient.vmInfo.Config.Memory.Size = int64(utils.MemUnit(clhConfig.MemorySize) * utils.MiB)
mockClient.vmInfo.Config.Memory.HotplugSize = int64(40 * utils.GiB.ToBytes())
mockClient.vmInfo.Config = *chclient.NewVmConfig(*chclient.NewKernelConfig(""))
mockClient.vmInfo.Config.Memory = chclient.NewMemoryConfig(int64(utils.MemUnit(clhConfig.MemorySize) * utils.MiB))
mockClient.vmInfo.Config.Memory.HotplugSize = func(i int64) *int64 { return &i }(int64(40 * utils.GiB.ToBytes()))
clh.APIClient = mockClient
clh.config = clhConfig

View File

@@ -753,7 +753,7 @@ func (c *Container) initConfigResourcesMemory() {
// newContainer creates a Container structure from a sandbox and a container configuration.
func newContainer(ctx context.Context, sandbox *Sandbox, contConfig *ContainerConfig) (*Container, error) {
span, ctx := katatrace.Trace(ctx, sandbox.Logger(), "newContainer", sandbox.tracingTags())
span, ctx := katatrace.Trace(ctx, nil, "newContainer", sandbox.tracingTags())
defer span.End()
if !contConfig.valid() {

View File

@@ -1165,7 +1165,11 @@ func (fc *firecracker) getThreadIDs(ctx context.Context) (vcpuThreadIDs, error)
if len(cpus) != 2 {
return vcpuInfo, errors.Errorf("Invalid fc thread info: %v", comm)
}
cpuID, err := strconv.ParseInt(cpus[1], 10, 32)
//Remove the leading whitespace
cpuIdStr := strings.TrimSpace(cpus[1])
cpuID, err := strconv.ParseInt(cpuIdStr, 10, 32)
if err != nil {
return vcpuInfo, errors.Wrapf(err, "Invalid fc thread info: %v", comm)
}

View File

@@ -68,6 +68,9 @@ const (
kernelParamDebugConsole = "agent.debug_console"
kernelParamDebugConsoleVPort = "agent.debug_console_vport"
kernelParamDebugConsoleVPortValue = "1026"
// Restricted permission for shared directory managed by virtiofs
sharedDirMode = os.FileMode(0700) | os.ModeDir
)
var (
@@ -516,7 +519,7 @@ func (k *kataAgent) setupSharedPath(ctx context.Context, sandbox *Sandbox) (err
// create shared path structure
sharePath := getSharePath(sandbox.id)
mountPath := getMountPath(sandbox.id)
if err := os.MkdirAll(sharePath, DirMode); err != nil {
if err := os.MkdirAll(sharePath, sharedDirMode); err != nil {
return err
}
if err := os.MkdirAll(mountPath, DirMode); err != nil {

View File

@@ -13,7 +13,7 @@ YQ := $(shell command -v yq 2> /dev/null)
generate-client-code: clean-generated-code
docker run --rm \
--user $$(id -u):$$(id -g) \
-v $${PWD}:/local openapitools/openapi-generator-cli:v4.3.1 generate \
-v $${PWD}:/local openapitools/openapi-generator-cli:v5.2.1 generate \
-i /local/cloud-hypervisor.yaml \
-g go \
-o /local/client

View File

@@ -0,0 +1,78 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
api_default.go
client.go
configuration.go
docs/BalloonConfig.md
docs/CmdLineConfig.md
docs/ConsoleConfig.md
docs/CpuTopology.md
docs/CpusConfig.md
docs/DefaultApi.md
docs/DeviceConfig.md
docs/DeviceNode.md
docs/DiskConfig.md
docs/FsConfig.md
docs/InitramfsConfig.md
docs/KernelConfig.md
docs/MemoryConfig.md
docs/MemoryZoneConfig.md
docs/NetConfig.md
docs/NumaConfig.md
docs/NumaDistance.md
docs/PciDeviceInfo.md
docs/PmemConfig.md
docs/RateLimiterConfig.md
docs/RestoreConfig.md
docs/RngConfig.md
docs/SgxEpcConfig.md
docs/TokenBucket.md
docs/VmAddDevice.md
docs/VmConfig.md
docs/VmInfo.md
docs/VmRemoveDevice.md
docs/VmResize.md
docs/VmResizeZone.md
docs/VmSnapshotConfig.md
docs/VmmPingResponse.md
docs/VsockConfig.md
git_push.sh
go.mod
go.sum
model_balloon_config.go
model_cmd_line_config.go
model_console_config.go
model_cpu_topology.go
model_cpus_config.go
model_device_config.go
model_device_node.go
model_disk_config.go
model_fs_config.go
model_initramfs_config.go
model_kernel_config.go
model_memory_config.go
model_memory_zone_config.go
model_net_config.go
model_numa_config.go
model_numa_distance.go
model_pci_device_info.go
model_pmem_config.go
model_rate_limiter_config.go
model_restore_config.go
model_rng_config.go
model_sgx_epc_config.go
model_token_bucket.go
model_vm_add_device.go
model_vm_config.go
model_vm_info.go
model_vm_remove_device.go
model_vm_resize.go
model_vm_resize_zone.go
model_vm_snapshot_config.go
model_vmm_ping_response.go
model_vsock_config.go
response.go
utils.go

View File

@@ -17,13 +17,59 @@ Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional
```
Put the package under your project folder and add the following in import:
```golang
import "./openapi"
import sw "./openapi"
```
To use a proxy, set the environment variable `HTTP_PROXY`:
```golang
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```
## Configuration of Server URL
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.
### Select Server Configuration
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.
```golang
ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)
```
### Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.
```golang
ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```
Note, enum values are always validated and all unused variables are silently ignored.
### URLs Configuration per Operation
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identifield by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.
```
ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
```
## Documentation for API Endpoints
@@ -98,6 +144,21 @@ Class | Method | HTTP request | Description
Endpoints do not require authorization.
## Documentation for Utility Methods
Due to the fact that model structure members are all pointers, this package contains
a number of utility functions to easily obtain pointers to values of basic types.
Each of these functions takes a value of the given basic type and returns a pointer to it:
* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`
## Author

View File

@@ -383,7 +383,7 @@ components:
id: id
hotplug_size: 1
hotplug_size: 3
hotplug_method: acpi
hotplug_method: Acpi
disks:
- path: path
num_queues: 7
@@ -540,7 +540,7 @@ components:
one_time_burst: 0
refill_time: 0
mac: mac
vhost_mode: client
vhost_mode: Client
iommu: false
vhost_socket: vhost_socket
vhost_user: false
@@ -563,7 +563,7 @@ components:
one_time_burst: 0
refill_time: 0
mac: mac
vhost_mode: client
vhost_mode: Client
iommu: false
vhost_socket: vhost_socket
vhost_user: false
@@ -688,7 +688,7 @@ components:
id: id
hotplug_size: 1
hotplug_size: 3
hotplug_method: acpi
hotplug_method: Acpi
disks:
- path: path
num_queues: 7
@@ -845,7 +845,7 @@ components:
one_time_burst: 0
refill_time: 0
mac: mac
vhost_mode: client
vhost_mode: Client
iommu: false
vhost_socket: vhost_socket
vhost_user: false
@@ -868,7 +868,7 @@ components:
one_time_burst: 0
refill_time: 0
mac: mac
vhost_mode: client
vhost_mode: Client
iommu: false
vhost_socket: vhost_socket
vhost_user: false
@@ -1053,7 +1053,7 @@ components:
id: id
hotplug_size: 1
hotplug_size: 3
hotplug_method: acpi
hotplug_method: Acpi
properties:
size:
format: int64
@@ -1068,7 +1068,7 @@ components:
default: false
type: boolean
hotplug_method:
default: acpi
default: Acpi
type: string
shared:
default: false
@@ -1236,7 +1236,7 @@ components:
one_time_burst: 0
refill_time: 0
mac: mac
vhost_mode: client
vhost_mode: Client
iommu: false
vhost_socket: vhost_socket
vhost_user: false
@@ -1272,7 +1272,7 @@ components:
vhost_socket:
type: string
vhost_mode:
default: client
default: Client
type: string
id:
type: string

View File

@@ -1,11 +1,12 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
@@ -100,7 +101,7 @@ func selectHeaderAccept(accepts []string) string {
return strings.Join(accepts, ",")
}
// contains is a case insenstive match, finding needle in a haystack
// contains is a case insensitive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.ToLower(a) == strings.ToLower(needle) {
@@ -179,15 +180,9 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
}
log.Printf("\n%s\n", string(dump))
}
return resp, err
}
// ChangeBasePath changes base path to allow switching to mocks
func (c *APIClient) ChangeBasePath(path string) {
c.cfg.BasePath = path
}
// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *Configuration {
@@ -354,7 +349,6 @@ func (c *APIClient) prepareRequest(
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
@@ -382,7 +376,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
return nil
}
if jsonCheck.MatchString(contentType) {
if err = json.Unmarshal(b, v); err != nil {
if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined
if err = unmarshalObj.UnmarshalJSON(b); err != nil {
return err
}
} else {
return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined")
}
} else if err = json.Unmarshal(b, v); err != nil { // simple model
return err
}
return nil
@@ -420,6 +422,8 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if fp, ok := body.(**os.File); ok {
_, err = bodyBuf.ReadFrom(*fp)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {

View File

@@ -1,15 +1,17 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"context"
"fmt"
"net/http"
"strings"
@@ -35,8 +37,23 @@ var (
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAccessToken = contextKey("accesstoken")
// ContextAPIKey takes an APIKey as authentication for the request
ContextAPIKey = contextKey("apikey")
// ContextAPIKeys takes a string apikey as authentication for the request
ContextAPIKeys = contextKey("apiKeys")
// ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
ContextHttpSignatureAuth = contextKey("httpsignature")
// ContextServerIndex uses a server configuration from the index.
ContextServerIndex = contextKey("serverIndex")
// ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerIndices = contextKey("serverOperationIndices")
// ContextServerVariables overrides a server configuration variables.
ContextServerVariables = contextKey("serverVariables")
// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextOperationServerVariables = contextKey("serverOperationVariables")
)
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
@@ -60,36 +77,39 @@ type ServerVariable struct {
// ServerConfiguration stores the information about a server
type ServerConfiguration struct {
Url string
URL string
Description string
Variables map[string]ServerVariable
}
// ServerConfigurations stores multiple ServerConfiguration items
type ServerConfigurations []ServerConfiguration
// Configuration stores the configuration of the API client
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Debug bool `json:"debug,omitempty"`
Servers []ServerConfiguration
HTTPClient *http.Client
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Debug bool `json:"debug,omitempty"`
Servers ServerConfigurations
OperationServers map[string]ServerConfigurations
HTTPClient *http.Client
}
// NewConfiguration returns a new Configuration object
func NewConfiguration() *Configuration {
cfg := &Configuration{
BasePath: "http://localhost/api/v1",
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Servers: []ServerConfiguration{
Servers: ServerConfigurations{
{
Url: "http://localhost/api/v1",
URL: "http://localhost/api/v1",
Description: "No description provided",
},
},
OperationServers: map[string]ServerConfigurations{},
}
return cfg
}
@@ -99,13 +119,13 @@ func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}
// ServerUrl returns URL based on server settings
func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) {
if index < 0 || len(c.Servers) <= index {
return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers)-1)
// URL formats template on a index using given variables
func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) {
if index < 0 || len(sc) <= index {
return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1)
}
server := c.Servers[index]
url := server.Url
server := sc[index]
url := server.URL
// go through variables and replace placeholders
for name, variable := range server.Variables {
@@ -126,3 +146,84 @@ func (c *Configuration) ServerUrl(index int, variables map[string]string) (strin
}
return url, nil
}
// ServerURL returns URL based on server settings
func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) {
return c.Servers.URL(index, variables)
}
func getServerIndex(ctx context.Context) (int, error) {
si := ctx.Value(ContextServerIndex)
if si != nil {
if index, ok := si.(int); ok {
return index, nil
}
return 0, reportError("Invalid type %T should be int", si)
}
return 0, nil
}
func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) {
osi := ctx.Value(ContextOperationServerIndices)
if osi != nil {
if operationIndices, ok := osi.(map[string]int); !ok {
return 0, reportError("Invalid type %T should be map[string]int", osi)
} else {
index, ok := operationIndices[endpoint]
if ok {
return index, nil
}
}
}
return getServerIndex(ctx)
}
func getServerVariables(ctx context.Context) (map[string]string, error) {
sv := ctx.Value(ContextServerVariables)
if sv != nil {
if variables, ok := sv.(map[string]string); ok {
return variables, nil
}
return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv)
}
return nil, nil
}
func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) {
osv := ctx.Value(ContextOperationServerVariables)
if osv != nil {
if operationVariables, ok := osv.(map[string]map[string]string); !ok {
return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv)
} else {
variables, ok := operationVariables[endpoint]
if ok {
return variables, nil
}
}
}
return getServerVariables(ctx)
}
// ServerURLWithContext returns a new server URL given an endpoint
func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) {
sc, ok := c.OperationServers[endpoint]
if !ok {
sc = c.Servers
}
if ctx == nil {
return sc.URL(0, nil)
}
index, err := getServerOperationIndex(ctx, endpoint)
if err != nil {
return "", err
}
variables, err := getServerOperationVariables(ctx, endpoint)
if err != nil {
return "", err
}
return sc.URL(index, variables)
}

View File

@@ -5,7 +5,72 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Size** | **int64** | |
**DeflateOnOom** | **bool** | Whether the balloon should deflate when the guest is under memory pressure. | [optional] [default to false]
**DeflateOnOom** | Pointer to **bool** | Whether the balloon should deflate when the guest is under memory pressure. | [optional] [default to false]
## Methods
### NewBalloonConfig
`func NewBalloonConfig(size int64, ) *BalloonConfig`
NewBalloonConfig instantiates a new BalloonConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewBalloonConfigWithDefaults
`func NewBalloonConfigWithDefaults() *BalloonConfig`
NewBalloonConfigWithDefaults instantiates a new BalloonConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetSize
`func (o *BalloonConfig) GetSize() int64`
GetSize returns the Size field if non-nil, zero value otherwise.
### GetSizeOk
`func (o *BalloonConfig) GetSizeOk() (*int64, bool)`
GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSize
`func (o *BalloonConfig) SetSize(v int64)`
SetSize sets Size field to given value.
### GetDeflateOnOom
`func (o *BalloonConfig) GetDeflateOnOom() bool`
GetDeflateOnOom returns the DeflateOnOom field if non-nil, zero value otherwise.
### GetDeflateOnOomOk
`func (o *BalloonConfig) GetDeflateOnOomOk() (*bool, bool)`
GetDeflateOnOomOk returns a tuple with the DeflateOnOom field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDeflateOnOom
`func (o *BalloonConfig) SetDeflateOnOom(v bool)`
SetDeflateOnOom sets DeflateOnOom field to given value.
### HasDeflateOnOom
`func (o *BalloonConfig) HasDeflateOnOom() bool`
HasDeflateOnOom returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,6 +6,46 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Args** | **string** | |
## Methods
### NewCmdLineConfig
`func NewCmdLineConfig(args string, ) *CmdLineConfig`
NewCmdLineConfig instantiates a new CmdLineConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewCmdLineConfigWithDefaults
`func NewCmdLineConfigWithDefaults() *CmdLineConfig`
NewCmdLineConfigWithDefaults instantiates a new CmdLineConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetArgs
`func (o *CmdLineConfig) GetArgs() string`
GetArgs returns the Args field if non-nil, zero value otherwise.
### GetArgsOk
`func (o *CmdLineConfig) GetArgsOk() (*string, bool)`
GetArgsOk returns a tuple with the Args field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetArgs
`func (o *CmdLineConfig) SetArgs(v string)`
SetArgs sets Args field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,9 +4,99 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**File** | **string** | | [optional]
**File** | Pointer to **string** | | [optional]
**Mode** | **string** | |
**Iommu** | **bool** | | [optional] [default to false]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
## Methods
### NewConsoleConfig
`func NewConsoleConfig(mode string, ) *ConsoleConfig`
NewConsoleConfig instantiates a new ConsoleConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewConsoleConfigWithDefaults
`func NewConsoleConfigWithDefaults() *ConsoleConfig`
NewConsoleConfigWithDefaults instantiates a new ConsoleConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetFile
`func (o *ConsoleConfig) GetFile() string`
GetFile returns the File field if non-nil, zero value otherwise.
### GetFileOk
`func (o *ConsoleConfig) GetFileOk() (*string, bool)`
GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetFile
`func (o *ConsoleConfig) SetFile(v string)`
SetFile sets File field to given value.
### HasFile
`func (o *ConsoleConfig) HasFile() bool`
HasFile returns a boolean if a field has been set.
### GetMode
`func (o *ConsoleConfig) GetMode() string`
GetMode returns the Mode field if non-nil, zero value otherwise.
### GetModeOk
`func (o *ConsoleConfig) GetModeOk() (*string, bool)`
GetModeOk returns a tuple with the Mode field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMode
`func (o *ConsoleConfig) SetMode(v string)`
SetMode sets Mode field to given value.
### GetIommu
`func (o *ConsoleConfig) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *ConsoleConfig) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *ConsoleConfig) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *ConsoleConfig) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,10 +4,130 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ThreadsPerCore** | **int32** | | [optional]
**CoresPerDie** | **int32** | | [optional]
**DiesPerPackage** | **int32** | | [optional]
**Packages** | **int32** | | [optional]
**ThreadsPerCore** | Pointer to **int32** | | [optional]
**CoresPerDie** | Pointer to **int32** | | [optional]
**DiesPerPackage** | Pointer to **int32** | | [optional]
**Packages** | Pointer to **int32** | | [optional]
## Methods
### NewCpuTopology
`func NewCpuTopology() *CpuTopology`
NewCpuTopology instantiates a new CpuTopology object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewCpuTopologyWithDefaults
`func NewCpuTopologyWithDefaults() *CpuTopology`
NewCpuTopologyWithDefaults instantiates a new CpuTopology object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetThreadsPerCore
`func (o *CpuTopology) GetThreadsPerCore() int32`
GetThreadsPerCore returns the ThreadsPerCore field if non-nil, zero value otherwise.
### GetThreadsPerCoreOk
`func (o *CpuTopology) GetThreadsPerCoreOk() (*int32, bool)`
GetThreadsPerCoreOk returns a tuple with the ThreadsPerCore field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetThreadsPerCore
`func (o *CpuTopology) SetThreadsPerCore(v int32)`
SetThreadsPerCore sets ThreadsPerCore field to given value.
### HasThreadsPerCore
`func (o *CpuTopology) HasThreadsPerCore() bool`
HasThreadsPerCore returns a boolean if a field has been set.
### GetCoresPerDie
`func (o *CpuTopology) GetCoresPerDie() int32`
GetCoresPerDie returns the CoresPerDie field if non-nil, zero value otherwise.
### GetCoresPerDieOk
`func (o *CpuTopology) GetCoresPerDieOk() (*int32, bool)`
GetCoresPerDieOk returns a tuple with the CoresPerDie field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCoresPerDie
`func (o *CpuTopology) SetCoresPerDie(v int32)`
SetCoresPerDie sets CoresPerDie field to given value.
### HasCoresPerDie
`func (o *CpuTopology) HasCoresPerDie() bool`
HasCoresPerDie returns a boolean if a field has been set.
### GetDiesPerPackage
`func (o *CpuTopology) GetDiesPerPackage() int32`
GetDiesPerPackage returns the DiesPerPackage field if non-nil, zero value otherwise.
### GetDiesPerPackageOk
`func (o *CpuTopology) GetDiesPerPackageOk() (*int32, bool)`
GetDiesPerPackageOk returns a tuple with the DiesPerPackage field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDiesPerPackage
`func (o *CpuTopology) SetDiesPerPackage(v int32)`
SetDiesPerPackage sets DiesPerPackage field to given value.
### HasDiesPerPackage
`func (o *CpuTopology) HasDiesPerPackage() bool`
HasDiesPerPackage returns a boolean if a field has been set.
### GetPackages
`func (o *CpuTopology) GetPackages() int32`
GetPackages returns the Packages field if non-nil, zero value otherwise.
### GetPackagesOk
`func (o *CpuTopology) GetPackagesOk() (*int32, bool)`
GetPackagesOk returns a tuple with the Packages field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPackages
`func (o *CpuTopology) SetPackages(v int32)`
SetPackages sets Packages field to given value.
### HasPackages
`func (o *CpuTopology) HasPackages() bool`
HasPackages returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,8 +6,118 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**BootVcpus** | **int32** | | [default to 1]
**MaxVcpus** | **int32** | | [default to 1]
**Topology** | [**CpuTopology**](CpuTopology.md) | | [optional]
**MaxPhysBits** | **int32** | | [optional]
**Topology** | Pointer to [**CpuTopology**](CpuTopology.md) | | [optional]
**MaxPhysBits** | Pointer to **int32** | | [optional]
## Methods
### NewCpusConfig
`func NewCpusConfig(bootVcpus int32, maxVcpus int32, ) *CpusConfig`
NewCpusConfig instantiates a new CpusConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewCpusConfigWithDefaults
`func NewCpusConfigWithDefaults() *CpusConfig`
NewCpusConfigWithDefaults instantiates a new CpusConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetBootVcpus
`func (o *CpusConfig) GetBootVcpus() int32`
GetBootVcpus returns the BootVcpus field if non-nil, zero value otherwise.
### GetBootVcpusOk
`func (o *CpusConfig) GetBootVcpusOk() (*int32, bool)`
GetBootVcpusOk returns a tuple with the BootVcpus field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetBootVcpus
`func (o *CpusConfig) SetBootVcpus(v int32)`
SetBootVcpus sets BootVcpus field to given value.
### GetMaxVcpus
`func (o *CpusConfig) GetMaxVcpus() int32`
GetMaxVcpus returns the MaxVcpus field if non-nil, zero value otherwise.
### GetMaxVcpusOk
`func (o *CpusConfig) GetMaxVcpusOk() (*int32, bool)`
GetMaxVcpusOk returns a tuple with the MaxVcpus field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMaxVcpus
`func (o *CpusConfig) SetMaxVcpus(v int32)`
SetMaxVcpus sets MaxVcpus field to given value.
### GetTopology
`func (o *CpusConfig) GetTopology() CpuTopology`
GetTopology returns the Topology field if non-nil, zero value otherwise.
### GetTopologyOk
`func (o *CpusConfig) GetTopologyOk() (*CpuTopology, bool)`
GetTopologyOk returns a tuple with the Topology field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetTopology
`func (o *CpusConfig) SetTopology(v CpuTopology)`
SetTopology sets Topology field to given value.
### HasTopology
`func (o *CpusConfig) HasTopology() bool`
HasTopology returns a boolean if a field has been set.
### GetMaxPhysBits
`func (o *CpusConfig) GetMaxPhysBits() int32`
GetMaxPhysBits returns the MaxPhysBits field if non-nil, zero value otherwise.
### GetMaxPhysBitsOk
`func (o *CpusConfig) GetMaxPhysBitsOk() (*int32, bool)`
GetMaxPhysBitsOk returns a tuple with the MaxPhysBits field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMaxPhysBits
`func (o *CpusConfig) SetMaxPhysBits(v int32)`
SetMaxPhysBits sets MaxPhysBits field to given value.
### HasMaxPhysBits
`func (o *CpusConfig) HasMaxPhysBits() bool`
HasMaxPhysBits returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,8 +5,98 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Path** | **string** | |
**Iommu** | **bool** | | [optional] [default to false]
**Id** | **string** | | [optional]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
**Id** | Pointer to **string** | | [optional]
## Methods
### NewDeviceConfig
`func NewDeviceConfig(path string, ) *DeviceConfig`
NewDeviceConfig instantiates a new DeviceConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewDeviceConfigWithDefaults
`func NewDeviceConfigWithDefaults() *DeviceConfig`
NewDeviceConfigWithDefaults instantiates a new DeviceConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetPath
`func (o *DeviceConfig) GetPath() string`
GetPath returns the Path field if non-nil, zero value otherwise.
### GetPathOk
`func (o *DeviceConfig) GetPathOk() (*string, bool)`
GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPath
`func (o *DeviceConfig) SetPath(v string)`
SetPath sets Path field to given value.
### GetIommu
`func (o *DeviceConfig) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *DeviceConfig) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *DeviceConfig) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *DeviceConfig) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
### GetId
`func (o *DeviceConfig) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *DeviceConfig) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *DeviceConfig) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *DeviceConfig) HasId() bool`
HasId returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,10 +4,130 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | | [optional]
**Resources** | **[]map[string]interface{}** | | [optional]
**Children** | **[]string** | | [optional]
**PciBdf** | **int32** | | [optional]
**Id** | Pointer to **string** | | [optional]
**Resources** | Pointer to **[]map[string]interface{}** | | [optional]
**Children** | Pointer to **[]string** | | [optional]
**PciBdf** | Pointer to **int32** | | [optional]
## Methods
### NewDeviceNode
`func NewDeviceNode() *DeviceNode`
NewDeviceNode instantiates a new DeviceNode object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewDeviceNodeWithDefaults
`func NewDeviceNodeWithDefaults() *DeviceNode`
NewDeviceNodeWithDefaults instantiates a new DeviceNode object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *DeviceNode) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *DeviceNode) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *DeviceNode) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *DeviceNode) HasId() bool`
HasId returns a boolean if a field has been set.
### GetResources
`func (o *DeviceNode) GetResources() []map[string]interface{}`
GetResources returns the Resources field if non-nil, zero value otherwise.
### GetResourcesOk
`func (o *DeviceNode) GetResourcesOk() (*[]map[string]interface{}, bool)`
GetResourcesOk returns a tuple with the Resources field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetResources
`func (o *DeviceNode) SetResources(v []map[string]interface{})`
SetResources sets Resources field to given value.
### HasResources
`func (o *DeviceNode) HasResources() bool`
HasResources returns a boolean if a field has been set.
### GetChildren
`func (o *DeviceNode) GetChildren() []string`
GetChildren returns the Children field if non-nil, zero value otherwise.
### GetChildrenOk
`func (o *DeviceNode) GetChildrenOk() (*[]string, bool)`
GetChildrenOk returns a tuple with the Children field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetChildren
`func (o *DeviceNode) SetChildren(v []string)`
SetChildren sets Children field to given value.
### HasChildren
`func (o *DeviceNode) HasChildren() bool`
HasChildren returns a boolean if a field has been set.
### GetPciBdf
`func (o *DeviceNode) GetPciBdf() int32`
GetPciBdf returns the PciBdf field if non-nil, zero value otherwise.
### GetPciBdfOk
`func (o *DeviceNode) GetPciBdfOk() (*int32, bool)`
GetPciBdfOk returns a tuple with the PciBdf field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPciBdf
`func (o *DeviceNode) SetPciBdf(v int32)`
SetPciBdf sets PciBdf field to given value.
### HasPciBdf
`func (o *DeviceNode) HasPciBdf() bool`
HasPciBdf returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,16 +5,306 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Path** | **string** | |
**Readonly** | **bool** | | [optional] [default to false]
**Direct** | **bool** | | [optional] [default to false]
**Iommu** | **bool** | | [optional] [default to false]
**NumQueues** | **int32** | | [optional] [default to 1]
**QueueSize** | **int32** | | [optional] [default to 128]
**VhostUser** | **bool** | | [optional] [default to false]
**VhostSocket** | **string** | | [optional]
**PollQueue** | **bool** | | [optional] [default to true]
**RateLimiterConfig** | [**RateLimiterConfig**](RateLimiterConfig.md) | | [optional]
**Id** | **string** | | [optional]
**Readonly** | Pointer to **bool** | | [optional] [default to false]
**Direct** | Pointer to **bool** | | [optional] [default to false]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
**NumQueues** | Pointer to **int32** | | [optional] [default to 1]
**QueueSize** | Pointer to **int32** | | [optional] [default to 128]
**VhostUser** | Pointer to **bool** | | [optional] [default to false]
**VhostSocket** | Pointer to **string** | | [optional]
**PollQueue** | Pointer to **bool** | | [optional] [default to true]
**RateLimiterConfig** | Pointer to [**RateLimiterConfig**](RateLimiterConfig.md) | | [optional]
**Id** | Pointer to **string** | | [optional]
## Methods
### NewDiskConfig
`func NewDiskConfig(path string, ) *DiskConfig`
NewDiskConfig instantiates a new DiskConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewDiskConfigWithDefaults
`func NewDiskConfigWithDefaults() *DiskConfig`
NewDiskConfigWithDefaults instantiates a new DiskConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetPath
`func (o *DiskConfig) GetPath() string`
GetPath returns the Path field if non-nil, zero value otherwise.
### GetPathOk
`func (o *DiskConfig) GetPathOk() (*string, bool)`
GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPath
`func (o *DiskConfig) SetPath(v string)`
SetPath sets Path field to given value.
### GetReadonly
`func (o *DiskConfig) GetReadonly() bool`
GetReadonly returns the Readonly field if non-nil, zero value otherwise.
### GetReadonlyOk
`func (o *DiskConfig) GetReadonlyOk() (*bool, bool)`
GetReadonlyOk returns a tuple with the Readonly field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetReadonly
`func (o *DiskConfig) SetReadonly(v bool)`
SetReadonly sets Readonly field to given value.
### HasReadonly
`func (o *DiskConfig) HasReadonly() bool`
HasReadonly returns a boolean if a field has been set.
### GetDirect
`func (o *DiskConfig) GetDirect() bool`
GetDirect returns the Direct field if non-nil, zero value otherwise.
### GetDirectOk
`func (o *DiskConfig) GetDirectOk() (*bool, bool)`
GetDirectOk returns a tuple with the Direct field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDirect
`func (o *DiskConfig) SetDirect(v bool)`
SetDirect sets Direct field to given value.
### HasDirect
`func (o *DiskConfig) HasDirect() bool`
HasDirect returns a boolean if a field has been set.
### GetIommu
`func (o *DiskConfig) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *DiskConfig) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *DiskConfig) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *DiskConfig) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
### GetNumQueues
`func (o *DiskConfig) GetNumQueues() int32`
GetNumQueues returns the NumQueues field if non-nil, zero value otherwise.
### GetNumQueuesOk
`func (o *DiskConfig) GetNumQueuesOk() (*int32, bool)`
GetNumQueuesOk returns a tuple with the NumQueues field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetNumQueues
`func (o *DiskConfig) SetNumQueues(v int32)`
SetNumQueues sets NumQueues field to given value.
### HasNumQueues
`func (o *DiskConfig) HasNumQueues() bool`
HasNumQueues returns a boolean if a field has been set.
### GetQueueSize
`func (o *DiskConfig) GetQueueSize() int32`
GetQueueSize returns the QueueSize field if non-nil, zero value otherwise.
### GetQueueSizeOk
`func (o *DiskConfig) GetQueueSizeOk() (*int32, bool)`
GetQueueSizeOk returns a tuple with the QueueSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetQueueSize
`func (o *DiskConfig) SetQueueSize(v int32)`
SetQueueSize sets QueueSize field to given value.
### HasQueueSize
`func (o *DiskConfig) HasQueueSize() bool`
HasQueueSize returns a boolean if a field has been set.
### GetVhostUser
`func (o *DiskConfig) GetVhostUser() bool`
GetVhostUser returns the VhostUser field if non-nil, zero value otherwise.
### GetVhostUserOk
`func (o *DiskConfig) GetVhostUserOk() (*bool, bool)`
GetVhostUserOk returns a tuple with the VhostUser field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVhostUser
`func (o *DiskConfig) SetVhostUser(v bool)`
SetVhostUser sets VhostUser field to given value.
### HasVhostUser
`func (o *DiskConfig) HasVhostUser() bool`
HasVhostUser returns a boolean if a field has been set.
### GetVhostSocket
`func (o *DiskConfig) GetVhostSocket() string`
GetVhostSocket returns the VhostSocket field if non-nil, zero value otherwise.
### GetVhostSocketOk
`func (o *DiskConfig) GetVhostSocketOk() (*string, bool)`
GetVhostSocketOk returns a tuple with the VhostSocket field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVhostSocket
`func (o *DiskConfig) SetVhostSocket(v string)`
SetVhostSocket sets VhostSocket field to given value.
### HasVhostSocket
`func (o *DiskConfig) HasVhostSocket() bool`
HasVhostSocket returns a boolean if a field has been set.
### GetPollQueue
`func (o *DiskConfig) GetPollQueue() bool`
GetPollQueue returns the PollQueue field if non-nil, zero value otherwise.
### GetPollQueueOk
`func (o *DiskConfig) GetPollQueueOk() (*bool, bool)`
GetPollQueueOk returns a tuple with the PollQueue field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPollQueue
`func (o *DiskConfig) SetPollQueue(v bool)`
SetPollQueue sets PollQueue field to given value.
### HasPollQueue
`func (o *DiskConfig) HasPollQueue() bool`
HasPollQueue returns a boolean if a field has been set.
### GetRateLimiterConfig
`func (o *DiskConfig) GetRateLimiterConfig() RateLimiterConfig`
GetRateLimiterConfig returns the RateLimiterConfig field if non-nil, zero value otherwise.
### GetRateLimiterConfigOk
`func (o *DiskConfig) GetRateLimiterConfigOk() (*RateLimiterConfig, bool)`
GetRateLimiterConfigOk returns a tuple with the RateLimiterConfig field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRateLimiterConfig
`func (o *DiskConfig) SetRateLimiterConfig(v RateLimiterConfig)`
SetRateLimiterConfig sets RateLimiterConfig field to given value.
### HasRateLimiterConfig
`func (o *DiskConfig) HasRateLimiterConfig() bool`
HasRateLimiterConfig returns a boolean if a field has been set.
### GetId
`func (o *DiskConfig) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *DiskConfig) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *DiskConfig) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *DiskConfig) HasId() bool`
HasId returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -10,7 +10,172 @@ Name | Type | Description | Notes
**QueueSize** | **int32** | | [default to 1024]
**Dax** | **bool** | | [default to true]
**CacheSize** | **int64** | |
**Id** | **string** | | [optional]
**Id** | Pointer to **string** | | [optional]
## Methods
### NewFsConfig
`func NewFsConfig(tag string, socket string, numQueues int32, queueSize int32, dax bool, cacheSize int64, ) *FsConfig`
NewFsConfig instantiates a new FsConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewFsConfigWithDefaults
`func NewFsConfigWithDefaults() *FsConfig`
NewFsConfigWithDefaults instantiates a new FsConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetTag
`func (o *FsConfig) GetTag() string`
GetTag returns the Tag field if non-nil, zero value otherwise.
### GetTagOk
`func (o *FsConfig) GetTagOk() (*string, bool)`
GetTagOk returns a tuple with the Tag field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetTag
`func (o *FsConfig) SetTag(v string)`
SetTag sets Tag field to given value.
### GetSocket
`func (o *FsConfig) GetSocket() string`
GetSocket returns the Socket field if non-nil, zero value otherwise.
### GetSocketOk
`func (o *FsConfig) GetSocketOk() (*string, bool)`
GetSocketOk returns a tuple with the Socket field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSocket
`func (o *FsConfig) SetSocket(v string)`
SetSocket sets Socket field to given value.
### GetNumQueues
`func (o *FsConfig) GetNumQueues() int32`
GetNumQueues returns the NumQueues field if non-nil, zero value otherwise.
### GetNumQueuesOk
`func (o *FsConfig) GetNumQueuesOk() (*int32, bool)`
GetNumQueuesOk returns a tuple with the NumQueues field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetNumQueues
`func (o *FsConfig) SetNumQueues(v int32)`
SetNumQueues sets NumQueues field to given value.
### GetQueueSize
`func (o *FsConfig) GetQueueSize() int32`
GetQueueSize returns the QueueSize field if non-nil, zero value otherwise.
### GetQueueSizeOk
`func (o *FsConfig) GetQueueSizeOk() (*int32, bool)`
GetQueueSizeOk returns a tuple with the QueueSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetQueueSize
`func (o *FsConfig) SetQueueSize(v int32)`
SetQueueSize sets QueueSize field to given value.
### GetDax
`func (o *FsConfig) GetDax() bool`
GetDax returns the Dax field if non-nil, zero value otherwise.
### GetDaxOk
`func (o *FsConfig) GetDaxOk() (*bool, bool)`
GetDaxOk returns a tuple with the Dax field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDax
`func (o *FsConfig) SetDax(v bool)`
SetDax sets Dax field to given value.
### GetCacheSize
`func (o *FsConfig) GetCacheSize() int64`
GetCacheSize returns the CacheSize field if non-nil, zero value otherwise.
### GetCacheSizeOk
`func (o *FsConfig) GetCacheSizeOk() (*int64, bool)`
GetCacheSizeOk returns a tuple with the CacheSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCacheSize
`func (o *FsConfig) SetCacheSize(v int64)`
SetCacheSize sets CacheSize field to given value.
### GetId
`func (o *FsConfig) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *FsConfig) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *FsConfig) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *FsConfig) HasId() bool`
HasId returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,6 +6,46 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Path** | **string** | |
## Methods
### NewInitramfsConfig
`func NewInitramfsConfig(path string, ) *InitramfsConfig`
NewInitramfsConfig instantiates a new InitramfsConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewInitramfsConfigWithDefaults
`func NewInitramfsConfigWithDefaults() *InitramfsConfig`
NewInitramfsConfigWithDefaults instantiates a new InitramfsConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetPath
`func (o *InitramfsConfig) GetPath() string`
GetPath returns the Path field if non-nil, zero value otherwise.
### GetPathOk
`func (o *InitramfsConfig) GetPathOk() (*string, bool)`
GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPath
`func (o *InitramfsConfig) SetPath(v string)`
SetPath sets Path field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,6 +6,46 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Path** | **string** | |
## Methods
### NewKernelConfig
`func NewKernelConfig(path string, ) *KernelConfig`
NewKernelConfig instantiates a new KernelConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewKernelConfigWithDefaults
`func NewKernelConfigWithDefaults() *KernelConfig`
NewKernelConfigWithDefaults instantiates a new KernelConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetPath
`func (o *KernelConfig) GetPath() string`
GetPath returns the Path field if non-nil, zero value otherwise.
### GetPathOk
`func (o *KernelConfig) GetPathOk() (*string, bool)`
GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPath
`func (o *KernelConfig) SetPath(v string)`
SetPath sets Path field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,14 +5,254 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Size** | **int64** | |
**HotplugSize** | **int64** | | [optional]
**HotpluggedSize** | **int64** | | [optional]
**Mergeable** | **bool** | | [optional] [default to false]
**HotplugMethod** | **string** | | [optional] [default to acpi]
**Shared** | **bool** | | [optional] [default to false]
**Hugepages** | **bool** | | [optional] [default to false]
**HugepageSize** | **int64** | | [optional]
**Zones** | [**[]MemoryZoneConfig**](MemoryZoneConfig.md) | | [optional]
**HotplugSize** | Pointer to **int64** | | [optional]
**HotpluggedSize** | Pointer to **int64** | | [optional]
**Mergeable** | Pointer to **bool** | | [optional] [default to false]
**HotplugMethod** | Pointer to **string** | | [optional] [default to "Acpi"]
**Shared** | Pointer to **bool** | | [optional] [default to false]
**Hugepages** | Pointer to **bool** | | [optional] [default to false]
**HugepageSize** | Pointer to **int64** | | [optional]
**Zones** | Pointer to [**[]MemoryZoneConfig**](MemoryZoneConfig.md) | | [optional]
## Methods
### NewMemoryConfig
`func NewMemoryConfig(size int64, ) *MemoryConfig`
NewMemoryConfig instantiates a new MemoryConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewMemoryConfigWithDefaults
`func NewMemoryConfigWithDefaults() *MemoryConfig`
NewMemoryConfigWithDefaults instantiates a new MemoryConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetSize
`func (o *MemoryConfig) GetSize() int64`
GetSize returns the Size field if non-nil, zero value otherwise.
### GetSizeOk
`func (o *MemoryConfig) GetSizeOk() (*int64, bool)`
GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSize
`func (o *MemoryConfig) SetSize(v int64)`
SetSize sets Size field to given value.
### GetHotplugSize
`func (o *MemoryConfig) GetHotplugSize() int64`
GetHotplugSize returns the HotplugSize field if non-nil, zero value otherwise.
### GetHotplugSizeOk
`func (o *MemoryConfig) GetHotplugSizeOk() (*int64, bool)`
GetHotplugSizeOk returns a tuple with the HotplugSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHotplugSize
`func (o *MemoryConfig) SetHotplugSize(v int64)`
SetHotplugSize sets HotplugSize field to given value.
### HasHotplugSize
`func (o *MemoryConfig) HasHotplugSize() bool`
HasHotplugSize returns a boolean if a field has been set.
### GetHotpluggedSize
`func (o *MemoryConfig) GetHotpluggedSize() int64`
GetHotpluggedSize returns the HotpluggedSize field if non-nil, zero value otherwise.
### GetHotpluggedSizeOk
`func (o *MemoryConfig) GetHotpluggedSizeOk() (*int64, bool)`
GetHotpluggedSizeOk returns a tuple with the HotpluggedSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHotpluggedSize
`func (o *MemoryConfig) SetHotpluggedSize(v int64)`
SetHotpluggedSize sets HotpluggedSize field to given value.
### HasHotpluggedSize
`func (o *MemoryConfig) HasHotpluggedSize() bool`
HasHotpluggedSize returns a boolean if a field has been set.
### GetMergeable
`func (o *MemoryConfig) GetMergeable() bool`
GetMergeable returns the Mergeable field if non-nil, zero value otherwise.
### GetMergeableOk
`func (o *MemoryConfig) GetMergeableOk() (*bool, bool)`
GetMergeableOk returns a tuple with the Mergeable field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMergeable
`func (o *MemoryConfig) SetMergeable(v bool)`
SetMergeable sets Mergeable field to given value.
### HasMergeable
`func (o *MemoryConfig) HasMergeable() bool`
HasMergeable returns a boolean if a field has been set.
### GetHotplugMethod
`func (o *MemoryConfig) GetHotplugMethod() string`
GetHotplugMethod returns the HotplugMethod field if non-nil, zero value otherwise.
### GetHotplugMethodOk
`func (o *MemoryConfig) GetHotplugMethodOk() (*string, bool)`
GetHotplugMethodOk returns a tuple with the HotplugMethod field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHotplugMethod
`func (o *MemoryConfig) SetHotplugMethod(v string)`
SetHotplugMethod sets HotplugMethod field to given value.
### HasHotplugMethod
`func (o *MemoryConfig) HasHotplugMethod() bool`
HasHotplugMethod returns a boolean if a field has been set.
### GetShared
`func (o *MemoryConfig) GetShared() bool`
GetShared returns the Shared field if non-nil, zero value otherwise.
### GetSharedOk
`func (o *MemoryConfig) GetSharedOk() (*bool, bool)`
GetSharedOk returns a tuple with the Shared field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetShared
`func (o *MemoryConfig) SetShared(v bool)`
SetShared sets Shared field to given value.
### HasShared
`func (o *MemoryConfig) HasShared() bool`
HasShared returns a boolean if a field has been set.
### GetHugepages
`func (o *MemoryConfig) GetHugepages() bool`
GetHugepages returns the Hugepages field if non-nil, zero value otherwise.
### GetHugepagesOk
`func (o *MemoryConfig) GetHugepagesOk() (*bool, bool)`
GetHugepagesOk returns a tuple with the Hugepages field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHugepages
`func (o *MemoryConfig) SetHugepages(v bool)`
SetHugepages sets Hugepages field to given value.
### HasHugepages
`func (o *MemoryConfig) HasHugepages() bool`
HasHugepages returns a boolean if a field has been set.
### GetHugepageSize
`func (o *MemoryConfig) GetHugepageSize() int64`
GetHugepageSize returns the HugepageSize field if non-nil, zero value otherwise.
### GetHugepageSizeOk
`func (o *MemoryConfig) GetHugepageSizeOk() (*int64, bool)`
GetHugepageSizeOk returns a tuple with the HugepageSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHugepageSize
`func (o *MemoryConfig) SetHugepageSize(v int64)`
SetHugepageSize sets HugepageSize field to given value.
### HasHugepageSize
`func (o *MemoryConfig) HasHugepageSize() bool`
HasHugepageSize returns a boolean if a field has been set.
### GetZones
`func (o *MemoryConfig) GetZones() []MemoryZoneConfig`
GetZones returns the Zones field if non-nil, zero value otherwise.
### GetZonesOk
`func (o *MemoryConfig) GetZonesOk() (*[]MemoryZoneConfig, bool)`
GetZonesOk returns a tuple with the Zones field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetZones
`func (o *MemoryConfig) SetZones(v []MemoryZoneConfig)`
SetZones sets Zones field to given value.
### HasZones
`func (o *MemoryConfig) HasZones() bool`
HasZones returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,14 +6,274 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | |
**Size** | **int64** | |
**File** | **string** | | [optional]
**Mergeable** | **bool** | | [optional] [default to false]
**Shared** | **bool** | | [optional] [default to false]
**Hugepages** | **bool** | | [optional] [default to false]
**HugepageSize** | **int64** | | [optional]
**HostNumaNode** | **int32** | | [optional]
**HotplugSize** | **int64** | | [optional]
**HotpluggedSize** | **int64** | | [optional]
**File** | Pointer to **string** | | [optional]
**Mergeable** | Pointer to **bool** | | [optional] [default to false]
**Shared** | Pointer to **bool** | | [optional] [default to false]
**Hugepages** | Pointer to **bool** | | [optional] [default to false]
**HugepageSize** | Pointer to **int64** | | [optional]
**HostNumaNode** | Pointer to **int32** | | [optional]
**HotplugSize** | Pointer to **int64** | | [optional]
**HotpluggedSize** | Pointer to **int64** | | [optional]
## Methods
### NewMemoryZoneConfig
`func NewMemoryZoneConfig(id string, size int64, ) *MemoryZoneConfig`
NewMemoryZoneConfig instantiates a new MemoryZoneConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewMemoryZoneConfigWithDefaults
`func NewMemoryZoneConfigWithDefaults() *MemoryZoneConfig`
NewMemoryZoneConfigWithDefaults instantiates a new MemoryZoneConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *MemoryZoneConfig) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *MemoryZoneConfig) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *MemoryZoneConfig) SetId(v string)`
SetId sets Id field to given value.
### GetSize
`func (o *MemoryZoneConfig) GetSize() int64`
GetSize returns the Size field if non-nil, zero value otherwise.
### GetSizeOk
`func (o *MemoryZoneConfig) GetSizeOk() (*int64, bool)`
GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSize
`func (o *MemoryZoneConfig) SetSize(v int64)`
SetSize sets Size field to given value.
### GetFile
`func (o *MemoryZoneConfig) GetFile() string`
GetFile returns the File field if non-nil, zero value otherwise.
### GetFileOk
`func (o *MemoryZoneConfig) GetFileOk() (*string, bool)`
GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetFile
`func (o *MemoryZoneConfig) SetFile(v string)`
SetFile sets File field to given value.
### HasFile
`func (o *MemoryZoneConfig) HasFile() bool`
HasFile returns a boolean if a field has been set.
### GetMergeable
`func (o *MemoryZoneConfig) GetMergeable() bool`
GetMergeable returns the Mergeable field if non-nil, zero value otherwise.
### GetMergeableOk
`func (o *MemoryZoneConfig) GetMergeableOk() (*bool, bool)`
GetMergeableOk returns a tuple with the Mergeable field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMergeable
`func (o *MemoryZoneConfig) SetMergeable(v bool)`
SetMergeable sets Mergeable field to given value.
### HasMergeable
`func (o *MemoryZoneConfig) HasMergeable() bool`
HasMergeable returns a boolean if a field has been set.
### GetShared
`func (o *MemoryZoneConfig) GetShared() bool`
GetShared returns the Shared field if non-nil, zero value otherwise.
### GetSharedOk
`func (o *MemoryZoneConfig) GetSharedOk() (*bool, bool)`
GetSharedOk returns a tuple with the Shared field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetShared
`func (o *MemoryZoneConfig) SetShared(v bool)`
SetShared sets Shared field to given value.
### HasShared
`func (o *MemoryZoneConfig) HasShared() bool`
HasShared returns a boolean if a field has been set.
### GetHugepages
`func (o *MemoryZoneConfig) GetHugepages() bool`
GetHugepages returns the Hugepages field if non-nil, zero value otherwise.
### GetHugepagesOk
`func (o *MemoryZoneConfig) GetHugepagesOk() (*bool, bool)`
GetHugepagesOk returns a tuple with the Hugepages field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHugepages
`func (o *MemoryZoneConfig) SetHugepages(v bool)`
SetHugepages sets Hugepages field to given value.
### HasHugepages
`func (o *MemoryZoneConfig) HasHugepages() bool`
HasHugepages returns a boolean if a field has been set.
### GetHugepageSize
`func (o *MemoryZoneConfig) GetHugepageSize() int64`
GetHugepageSize returns the HugepageSize field if non-nil, zero value otherwise.
### GetHugepageSizeOk
`func (o *MemoryZoneConfig) GetHugepageSizeOk() (*int64, bool)`
GetHugepageSizeOk returns a tuple with the HugepageSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHugepageSize
`func (o *MemoryZoneConfig) SetHugepageSize(v int64)`
SetHugepageSize sets HugepageSize field to given value.
### HasHugepageSize
`func (o *MemoryZoneConfig) HasHugepageSize() bool`
HasHugepageSize returns a boolean if a field has been set.
### GetHostNumaNode
`func (o *MemoryZoneConfig) GetHostNumaNode() int32`
GetHostNumaNode returns the HostNumaNode field if non-nil, zero value otherwise.
### GetHostNumaNodeOk
`func (o *MemoryZoneConfig) GetHostNumaNodeOk() (*int32, bool)`
GetHostNumaNodeOk returns a tuple with the HostNumaNode field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHostNumaNode
`func (o *MemoryZoneConfig) SetHostNumaNode(v int32)`
SetHostNumaNode sets HostNumaNode field to given value.
### HasHostNumaNode
`func (o *MemoryZoneConfig) HasHostNumaNode() bool`
HasHostNumaNode returns a boolean if a field has been set.
### GetHotplugSize
`func (o *MemoryZoneConfig) GetHotplugSize() int64`
GetHotplugSize returns the HotplugSize field if non-nil, zero value otherwise.
### GetHotplugSizeOk
`func (o *MemoryZoneConfig) GetHotplugSizeOk() (*int64, bool)`
GetHotplugSizeOk returns a tuple with the HotplugSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHotplugSize
`func (o *MemoryZoneConfig) SetHotplugSize(v int64)`
SetHotplugSize sets HotplugSize field to given value.
### HasHotplugSize
`func (o *MemoryZoneConfig) HasHotplugSize() bool`
HasHotplugSize returns a boolean if a field has been set.
### GetHotpluggedSize
`func (o *MemoryZoneConfig) GetHotpluggedSize() int64`
GetHotpluggedSize returns the HotpluggedSize field if non-nil, zero value otherwise.
### GetHotpluggedSizeOk
`func (o *MemoryZoneConfig) GetHotpluggedSizeOk() (*int64, bool)`
GetHotpluggedSizeOk returns a tuple with the HotpluggedSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHotpluggedSize
`func (o *MemoryZoneConfig) SetHotpluggedSize(v int64)`
SetHotpluggedSize sets HotpluggedSize field to given value.
### HasHotpluggedSize
`func (o *MemoryZoneConfig) HasHotpluggedSize() bool`
HasHotpluggedSize returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,19 +4,364 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Tap** | **string** | | [optional] [default to ]
**Ip** | **string** | | [optional] [default to 192.168.249.1]
**Mask** | **string** | | [optional] [default to 255.255.255.0]
**Mac** | **string** | | [optional]
**Iommu** | **bool** | | [optional] [default to false]
**NumQueues** | **int32** | | [optional] [default to 2]
**QueueSize** | **int32** | | [optional] [default to 256]
**VhostUser** | **bool** | | [optional] [default to false]
**VhostSocket** | **string** | | [optional]
**VhostMode** | **string** | | [optional] [default to client]
**Id** | **string** | | [optional]
**Fd** | **[]int32** | | [optional]
**RateLimiterConfig** | [**RateLimiterConfig**](RateLimiterConfig.md) | | [optional]
**Tap** | Pointer to **string** | | [optional] [default to ""]
**Ip** | Pointer to **string** | | [optional] [default to "192.168.249.1"]
**Mask** | Pointer to **string** | | [optional] [default to "255.255.255.0"]
**Mac** | Pointer to **string** | | [optional]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
**NumQueues** | Pointer to **int32** | | [optional] [default to 2]
**QueueSize** | Pointer to **int32** | | [optional] [default to 256]
**VhostUser** | Pointer to **bool** | | [optional] [default to false]
**VhostSocket** | Pointer to **string** | | [optional]
**VhostMode** | Pointer to **string** | | [optional] [default to "Client"]
**Id** | Pointer to **string** | | [optional]
**Fd** | Pointer to **[]int32** | | [optional]
**RateLimiterConfig** | Pointer to [**RateLimiterConfig**](RateLimiterConfig.md) | | [optional]
## Methods
### NewNetConfig
`func NewNetConfig() *NetConfig`
NewNetConfig instantiates a new NetConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewNetConfigWithDefaults
`func NewNetConfigWithDefaults() *NetConfig`
NewNetConfigWithDefaults instantiates a new NetConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetTap
`func (o *NetConfig) GetTap() string`
GetTap returns the Tap field if non-nil, zero value otherwise.
### GetTapOk
`func (o *NetConfig) GetTapOk() (*string, bool)`
GetTapOk returns a tuple with the Tap field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetTap
`func (o *NetConfig) SetTap(v string)`
SetTap sets Tap field to given value.
### HasTap
`func (o *NetConfig) HasTap() bool`
HasTap returns a boolean if a field has been set.
### GetIp
`func (o *NetConfig) GetIp() string`
GetIp returns the Ip field if non-nil, zero value otherwise.
### GetIpOk
`func (o *NetConfig) GetIpOk() (*string, bool)`
GetIpOk returns a tuple with the Ip field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIp
`func (o *NetConfig) SetIp(v string)`
SetIp sets Ip field to given value.
### HasIp
`func (o *NetConfig) HasIp() bool`
HasIp returns a boolean if a field has been set.
### GetMask
`func (o *NetConfig) GetMask() string`
GetMask returns the Mask field if non-nil, zero value otherwise.
### GetMaskOk
`func (o *NetConfig) GetMaskOk() (*string, bool)`
GetMaskOk returns a tuple with the Mask field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMask
`func (o *NetConfig) SetMask(v string)`
SetMask sets Mask field to given value.
### HasMask
`func (o *NetConfig) HasMask() bool`
HasMask returns a boolean if a field has been set.
### GetMac
`func (o *NetConfig) GetMac() string`
GetMac returns the Mac field if non-nil, zero value otherwise.
### GetMacOk
`func (o *NetConfig) GetMacOk() (*string, bool)`
GetMacOk returns a tuple with the Mac field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMac
`func (o *NetConfig) SetMac(v string)`
SetMac sets Mac field to given value.
### HasMac
`func (o *NetConfig) HasMac() bool`
HasMac returns a boolean if a field has been set.
### GetIommu
`func (o *NetConfig) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *NetConfig) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *NetConfig) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *NetConfig) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
### GetNumQueues
`func (o *NetConfig) GetNumQueues() int32`
GetNumQueues returns the NumQueues field if non-nil, zero value otherwise.
### GetNumQueuesOk
`func (o *NetConfig) GetNumQueuesOk() (*int32, bool)`
GetNumQueuesOk returns a tuple with the NumQueues field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetNumQueues
`func (o *NetConfig) SetNumQueues(v int32)`
SetNumQueues sets NumQueues field to given value.
### HasNumQueues
`func (o *NetConfig) HasNumQueues() bool`
HasNumQueues returns a boolean if a field has been set.
### GetQueueSize
`func (o *NetConfig) GetQueueSize() int32`
GetQueueSize returns the QueueSize field if non-nil, zero value otherwise.
### GetQueueSizeOk
`func (o *NetConfig) GetQueueSizeOk() (*int32, bool)`
GetQueueSizeOk returns a tuple with the QueueSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetQueueSize
`func (o *NetConfig) SetQueueSize(v int32)`
SetQueueSize sets QueueSize field to given value.
### HasQueueSize
`func (o *NetConfig) HasQueueSize() bool`
HasQueueSize returns a boolean if a field has been set.
### GetVhostUser
`func (o *NetConfig) GetVhostUser() bool`
GetVhostUser returns the VhostUser field if non-nil, zero value otherwise.
### GetVhostUserOk
`func (o *NetConfig) GetVhostUserOk() (*bool, bool)`
GetVhostUserOk returns a tuple with the VhostUser field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVhostUser
`func (o *NetConfig) SetVhostUser(v bool)`
SetVhostUser sets VhostUser field to given value.
### HasVhostUser
`func (o *NetConfig) HasVhostUser() bool`
HasVhostUser returns a boolean if a field has been set.
### GetVhostSocket
`func (o *NetConfig) GetVhostSocket() string`
GetVhostSocket returns the VhostSocket field if non-nil, zero value otherwise.
### GetVhostSocketOk
`func (o *NetConfig) GetVhostSocketOk() (*string, bool)`
GetVhostSocketOk returns a tuple with the VhostSocket field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVhostSocket
`func (o *NetConfig) SetVhostSocket(v string)`
SetVhostSocket sets VhostSocket field to given value.
### HasVhostSocket
`func (o *NetConfig) HasVhostSocket() bool`
HasVhostSocket returns a boolean if a field has been set.
### GetVhostMode
`func (o *NetConfig) GetVhostMode() string`
GetVhostMode returns the VhostMode field if non-nil, zero value otherwise.
### GetVhostModeOk
`func (o *NetConfig) GetVhostModeOk() (*string, bool)`
GetVhostModeOk returns a tuple with the VhostMode field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVhostMode
`func (o *NetConfig) SetVhostMode(v string)`
SetVhostMode sets VhostMode field to given value.
### HasVhostMode
`func (o *NetConfig) HasVhostMode() bool`
HasVhostMode returns a boolean if a field has been set.
### GetId
`func (o *NetConfig) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *NetConfig) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *NetConfig) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *NetConfig) HasId() bool`
HasId returns a boolean if a field has been set.
### GetFd
`func (o *NetConfig) GetFd() []int32`
GetFd returns the Fd field if non-nil, zero value otherwise.
### GetFdOk
`func (o *NetConfig) GetFdOk() (*[]int32, bool)`
GetFdOk returns a tuple with the Fd field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetFd
`func (o *NetConfig) SetFd(v []int32)`
SetFd sets Fd field to given value.
### HasFd
`func (o *NetConfig) HasFd() bool`
HasFd returns a boolean if a field has been set.
### GetRateLimiterConfig
`func (o *NetConfig) GetRateLimiterConfig() RateLimiterConfig`
GetRateLimiterConfig returns the RateLimiterConfig field if non-nil, zero value otherwise.
### GetRateLimiterConfigOk
`func (o *NetConfig) GetRateLimiterConfigOk() (*RateLimiterConfig, bool)`
GetRateLimiterConfigOk returns a tuple with the RateLimiterConfig field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRateLimiterConfig
`func (o *NetConfig) SetRateLimiterConfig(v RateLimiterConfig)`
SetRateLimiterConfig sets RateLimiterConfig field to given value.
### HasRateLimiterConfig
`func (o *NetConfig) HasRateLimiterConfig() bool`
HasRateLimiterConfig returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,10 +5,150 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**GuestNumaId** | **int32** | |
**Cpus** | **[]int32** | | [optional]
**Distances** | [**[]NumaDistance**](NumaDistance.md) | | [optional]
**MemoryZones** | **[]string** | | [optional]
**SgxEpcSections** | **[]string** | | [optional]
**Cpus** | Pointer to **[]int32** | | [optional]
**Distances** | Pointer to [**[]NumaDistance**](NumaDistance.md) | | [optional]
**MemoryZones** | Pointer to **[]string** | | [optional]
**SgxEpcSections** | Pointer to **[]string** | | [optional]
## Methods
### NewNumaConfig
`func NewNumaConfig(guestNumaId int32, ) *NumaConfig`
NewNumaConfig instantiates a new NumaConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewNumaConfigWithDefaults
`func NewNumaConfigWithDefaults() *NumaConfig`
NewNumaConfigWithDefaults instantiates a new NumaConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetGuestNumaId
`func (o *NumaConfig) GetGuestNumaId() int32`
GetGuestNumaId returns the GuestNumaId field if non-nil, zero value otherwise.
### GetGuestNumaIdOk
`func (o *NumaConfig) GetGuestNumaIdOk() (*int32, bool)`
GetGuestNumaIdOk returns a tuple with the GuestNumaId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetGuestNumaId
`func (o *NumaConfig) SetGuestNumaId(v int32)`
SetGuestNumaId sets GuestNumaId field to given value.
### GetCpus
`func (o *NumaConfig) GetCpus() []int32`
GetCpus returns the Cpus field if non-nil, zero value otherwise.
### GetCpusOk
`func (o *NumaConfig) GetCpusOk() (*[]int32, bool)`
GetCpusOk returns a tuple with the Cpus field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCpus
`func (o *NumaConfig) SetCpus(v []int32)`
SetCpus sets Cpus field to given value.
### HasCpus
`func (o *NumaConfig) HasCpus() bool`
HasCpus returns a boolean if a field has been set.
### GetDistances
`func (o *NumaConfig) GetDistances() []NumaDistance`
GetDistances returns the Distances field if non-nil, zero value otherwise.
### GetDistancesOk
`func (o *NumaConfig) GetDistancesOk() (*[]NumaDistance, bool)`
GetDistancesOk returns a tuple with the Distances field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDistances
`func (o *NumaConfig) SetDistances(v []NumaDistance)`
SetDistances sets Distances field to given value.
### HasDistances
`func (o *NumaConfig) HasDistances() bool`
HasDistances returns a boolean if a field has been set.
### GetMemoryZones
`func (o *NumaConfig) GetMemoryZones() []string`
GetMemoryZones returns the MemoryZones field if non-nil, zero value otherwise.
### GetMemoryZonesOk
`func (o *NumaConfig) GetMemoryZonesOk() (*[]string, bool)`
GetMemoryZonesOk returns a tuple with the MemoryZones field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMemoryZones
`func (o *NumaConfig) SetMemoryZones(v []string)`
SetMemoryZones sets MemoryZones field to given value.
### HasMemoryZones
`func (o *NumaConfig) HasMemoryZones() bool`
HasMemoryZones returns a boolean if a field has been set.
### GetSgxEpcSections
`func (o *NumaConfig) GetSgxEpcSections() []string`
GetSgxEpcSections returns the SgxEpcSections field if non-nil, zero value otherwise.
### GetSgxEpcSectionsOk
`func (o *NumaConfig) GetSgxEpcSectionsOk() (*[]string, bool)`
GetSgxEpcSectionsOk returns a tuple with the SgxEpcSections field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSgxEpcSections
`func (o *NumaConfig) SetSgxEpcSections(v []string)`
SetSgxEpcSections sets SgxEpcSections field to given value.
### HasSgxEpcSections
`func (o *NumaConfig) HasSgxEpcSections() bool`
HasSgxEpcSections returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -7,6 +7,66 @@ Name | Type | Description | Notes
**Destination** | **int32** | |
**Distance** | **int32** | |
## Methods
### NewNumaDistance
`func NewNumaDistance(destination int32, distance int32, ) *NumaDistance`
NewNumaDistance instantiates a new NumaDistance object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewNumaDistanceWithDefaults
`func NewNumaDistanceWithDefaults() *NumaDistance`
NewNumaDistanceWithDefaults instantiates a new NumaDistance object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetDestination
`func (o *NumaDistance) GetDestination() int32`
GetDestination returns the Destination field if non-nil, zero value otherwise.
### GetDestinationOk
`func (o *NumaDistance) GetDestinationOk() (*int32, bool)`
GetDestinationOk returns a tuple with the Destination field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDestination
`func (o *NumaDistance) SetDestination(v int32)`
SetDestination sets Destination field to given value.
### GetDistance
`func (o *NumaDistance) GetDistance() int32`
GetDistance returns the Distance field if non-nil, zero value otherwise.
### GetDistanceOk
`func (o *NumaDistance) GetDistanceOk() (*int32, bool)`
GetDistanceOk returns a tuple with the Distance field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDistance
`func (o *NumaDistance) SetDistance(v int32)`
SetDistance sets Distance field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -7,6 +7,66 @@ Name | Type | Description | Notes
**Id** | **string** | |
**Bdf** | **string** | |
## Methods
### NewPciDeviceInfo
`func NewPciDeviceInfo(id string, bdf string, ) *PciDeviceInfo`
NewPciDeviceInfo instantiates a new PciDeviceInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewPciDeviceInfoWithDefaults
`func NewPciDeviceInfoWithDefaults() *PciDeviceInfo`
NewPciDeviceInfoWithDefaults instantiates a new PciDeviceInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *PciDeviceInfo) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *PciDeviceInfo) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *PciDeviceInfo) SetId(v string)`
SetId sets Id field to given value.
### GetBdf
`func (o *PciDeviceInfo) GetBdf() string`
GetBdf returns the Bdf field if non-nil, zero value otherwise.
### GetBdfOk
`func (o *PciDeviceInfo) GetBdfOk() (*string, bool)`
GetBdfOk returns a tuple with the Bdf field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetBdf
`func (o *PciDeviceInfo) SetBdf(v string)`
SetBdf sets Bdf field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,11 +5,176 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**File** | **string** | |
**Size** | **int64** | | [optional]
**Iommu** | **bool** | | [optional] [default to false]
**Mergeable** | **bool** | | [optional] [default to false]
**DiscardWrites** | **bool** | | [optional] [default to false]
**Id** | **string** | | [optional]
**Size** | Pointer to **int64** | | [optional]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
**Mergeable** | Pointer to **bool** | | [optional] [default to false]
**DiscardWrites** | Pointer to **bool** | | [optional] [default to false]
**Id** | Pointer to **string** | | [optional]
## Methods
### NewPmemConfig
`func NewPmemConfig(file string, ) *PmemConfig`
NewPmemConfig instantiates a new PmemConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewPmemConfigWithDefaults
`func NewPmemConfigWithDefaults() *PmemConfig`
NewPmemConfigWithDefaults instantiates a new PmemConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetFile
`func (o *PmemConfig) GetFile() string`
GetFile returns the File field if non-nil, zero value otherwise.
### GetFileOk
`func (o *PmemConfig) GetFileOk() (*string, bool)`
GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetFile
`func (o *PmemConfig) SetFile(v string)`
SetFile sets File field to given value.
### GetSize
`func (o *PmemConfig) GetSize() int64`
GetSize returns the Size field if non-nil, zero value otherwise.
### GetSizeOk
`func (o *PmemConfig) GetSizeOk() (*int64, bool)`
GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSize
`func (o *PmemConfig) SetSize(v int64)`
SetSize sets Size field to given value.
### HasSize
`func (o *PmemConfig) HasSize() bool`
HasSize returns a boolean if a field has been set.
### GetIommu
`func (o *PmemConfig) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *PmemConfig) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *PmemConfig) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *PmemConfig) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
### GetMergeable
`func (o *PmemConfig) GetMergeable() bool`
GetMergeable returns the Mergeable field if non-nil, zero value otherwise.
### GetMergeableOk
`func (o *PmemConfig) GetMergeableOk() (*bool, bool)`
GetMergeableOk returns a tuple with the Mergeable field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMergeable
`func (o *PmemConfig) SetMergeable(v bool)`
SetMergeable sets Mergeable field to given value.
### HasMergeable
`func (o *PmemConfig) HasMergeable() bool`
HasMergeable returns a boolean if a field has been set.
### GetDiscardWrites
`func (o *PmemConfig) GetDiscardWrites() bool`
GetDiscardWrites returns the DiscardWrites field if non-nil, zero value otherwise.
### GetDiscardWritesOk
`func (o *PmemConfig) GetDiscardWritesOk() (*bool, bool)`
GetDiscardWritesOk returns a tuple with the DiscardWrites field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDiscardWrites
`func (o *PmemConfig) SetDiscardWrites(v bool)`
SetDiscardWrites sets DiscardWrites field to given value.
### HasDiscardWrites
`func (o *PmemConfig) HasDiscardWrites() bool`
HasDiscardWrites returns a boolean if a field has been set.
### GetId
`func (o *PmemConfig) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *PmemConfig) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *PmemConfig) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *PmemConfig) HasId() bool`
HasId returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,8 +4,78 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bandwidth** | [**TokenBucket**](TokenBucket.md) | | [optional]
**Ops** | [**TokenBucket**](TokenBucket.md) | | [optional]
**Bandwidth** | Pointer to [**TokenBucket**](TokenBucket.md) | | [optional]
**Ops** | Pointer to [**TokenBucket**](TokenBucket.md) | | [optional]
## Methods
### NewRateLimiterConfig
`func NewRateLimiterConfig() *RateLimiterConfig`
NewRateLimiterConfig instantiates a new RateLimiterConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewRateLimiterConfigWithDefaults
`func NewRateLimiterConfigWithDefaults() *RateLimiterConfig`
NewRateLimiterConfigWithDefaults instantiates a new RateLimiterConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetBandwidth
`func (o *RateLimiterConfig) GetBandwidth() TokenBucket`
GetBandwidth returns the Bandwidth field if non-nil, zero value otherwise.
### GetBandwidthOk
`func (o *RateLimiterConfig) GetBandwidthOk() (*TokenBucket, bool)`
GetBandwidthOk returns a tuple with the Bandwidth field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetBandwidth
`func (o *RateLimiterConfig) SetBandwidth(v TokenBucket)`
SetBandwidth sets Bandwidth field to given value.
### HasBandwidth
`func (o *RateLimiterConfig) HasBandwidth() bool`
HasBandwidth returns a boolean if a field has been set.
### GetOps
`func (o *RateLimiterConfig) GetOps() TokenBucket`
GetOps returns the Ops field if non-nil, zero value otherwise.
### GetOpsOk
`func (o *RateLimiterConfig) GetOpsOk() (*TokenBucket, bool)`
GetOpsOk returns a tuple with the Ops field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetOps
`func (o *RateLimiterConfig) SetOps(v TokenBucket)`
SetOps sets Ops field to given value.
### HasOps
`func (o *RateLimiterConfig) HasOps() bool`
HasOps returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,7 +5,72 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SourceUrl** | **string** | |
**Prefault** | **bool** | | [optional]
**Prefault** | Pointer to **bool** | | [optional]
## Methods
### NewRestoreConfig
`func NewRestoreConfig(sourceUrl string, ) *RestoreConfig`
NewRestoreConfig instantiates a new RestoreConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewRestoreConfigWithDefaults
`func NewRestoreConfigWithDefaults() *RestoreConfig`
NewRestoreConfigWithDefaults instantiates a new RestoreConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetSourceUrl
`func (o *RestoreConfig) GetSourceUrl() string`
GetSourceUrl returns the SourceUrl field if non-nil, zero value otherwise.
### GetSourceUrlOk
`func (o *RestoreConfig) GetSourceUrlOk() (*string, bool)`
GetSourceUrlOk returns a tuple with the SourceUrl field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSourceUrl
`func (o *RestoreConfig) SetSourceUrl(v string)`
SetSourceUrl sets SourceUrl field to given value.
### GetPrefault
`func (o *RestoreConfig) GetPrefault() bool`
GetPrefault returns the Prefault field if non-nil, zero value otherwise.
### GetPrefaultOk
`func (o *RestoreConfig) GetPrefaultOk() (*bool, bool)`
GetPrefaultOk returns a tuple with the Prefault field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPrefault
`func (o *RestoreConfig) SetPrefault(v bool)`
SetPrefault sets Prefault field to given value.
### HasPrefault
`func (o *RestoreConfig) HasPrefault() bool`
HasPrefault returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,8 +4,73 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Src** | **string** | | [default to /dev/urandom]
**Iommu** | **bool** | | [optional] [default to false]
**Src** | **string** | | [default to "/dev/urandom"]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
## Methods
### NewRngConfig
`func NewRngConfig(src string, ) *RngConfig`
NewRngConfig instantiates a new RngConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewRngConfigWithDefaults
`func NewRngConfigWithDefaults() *RngConfig`
NewRngConfigWithDefaults instantiates a new RngConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetSrc
`func (o *RngConfig) GetSrc() string`
GetSrc returns the Src field if non-nil, zero value otherwise.
### GetSrcOk
`func (o *RngConfig) GetSrcOk() (*string, bool)`
GetSrcOk returns a tuple with the Src field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSrc
`func (o *RngConfig) SetSrc(v string)`
SetSrc sets Src field to given value.
### GetIommu
`func (o *RngConfig) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *RngConfig) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *RngConfig) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *RngConfig) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,7 +6,92 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | |
**Size** | **int64** | |
**Prefault** | **bool** | | [optional] [default to false]
**Prefault** | Pointer to **bool** | | [optional] [default to false]
## Methods
### NewSgxEpcConfig
`func NewSgxEpcConfig(id string, size int64, ) *SgxEpcConfig`
NewSgxEpcConfig instantiates a new SgxEpcConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewSgxEpcConfigWithDefaults
`func NewSgxEpcConfigWithDefaults() *SgxEpcConfig`
NewSgxEpcConfigWithDefaults instantiates a new SgxEpcConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *SgxEpcConfig) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *SgxEpcConfig) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *SgxEpcConfig) SetId(v string)`
SetId sets Id field to given value.
### GetSize
`func (o *SgxEpcConfig) GetSize() int64`
GetSize returns the Size field if non-nil, zero value otherwise.
### GetSizeOk
`func (o *SgxEpcConfig) GetSizeOk() (*int64, bool)`
GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSize
`func (o *SgxEpcConfig) SetSize(v int64)`
SetSize sets Size field to given value.
### GetPrefault
`func (o *SgxEpcConfig) GetPrefault() bool`
GetPrefault returns the Prefault field if non-nil, zero value otherwise.
### GetPrefaultOk
`func (o *SgxEpcConfig) GetPrefaultOk() (*bool, bool)`
GetPrefaultOk returns a tuple with the Prefault field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPrefault
`func (o *SgxEpcConfig) SetPrefault(v bool)`
SetPrefault sets Prefault field to given value.
### HasPrefault
`func (o *SgxEpcConfig) HasPrefault() bool`
HasPrefault returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,9 +5,94 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Size** | **int64** | The total number of tokens this bucket can hold. |
**OneTimeBurst** | **int64** | The initial size of a token bucket. | [optional]
**OneTimeBurst** | Pointer to **int64** | The initial size of a token bucket. | [optional]
**RefillTime** | **int64** | The amount of milliseconds it takes for the bucket to refill. |
## Methods
### NewTokenBucket
`func NewTokenBucket(size int64, refillTime int64, ) *TokenBucket`
NewTokenBucket instantiates a new TokenBucket object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewTokenBucketWithDefaults
`func NewTokenBucketWithDefaults() *TokenBucket`
NewTokenBucketWithDefaults instantiates a new TokenBucket object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetSize
`func (o *TokenBucket) GetSize() int64`
GetSize returns the Size field if non-nil, zero value otherwise.
### GetSizeOk
`func (o *TokenBucket) GetSizeOk() (*int64, bool)`
GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSize
`func (o *TokenBucket) SetSize(v int64)`
SetSize sets Size field to given value.
### GetOneTimeBurst
`func (o *TokenBucket) GetOneTimeBurst() int64`
GetOneTimeBurst returns the OneTimeBurst field if non-nil, zero value otherwise.
### GetOneTimeBurstOk
`func (o *TokenBucket) GetOneTimeBurstOk() (*int64, bool)`
GetOneTimeBurstOk returns a tuple with the OneTimeBurst field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetOneTimeBurst
`func (o *TokenBucket) SetOneTimeBurst(v int64)`
SetOneTimeBurst sets OneTimeBurst field to given value.
### HasOneTimeBurst
`func (o *TokenBucket) HasOneTimeBurst() bool`
HasOneTimeBurst returns a boolean if a field has been set.
### GetRefillTime
`func (o *TokenBucket) GetRefillTime() int64`
GetRefillTime returns the RefillTime field if non-nil, zero value otherwise.
### GetRefillTimeOk
`func (o *TokenBucket) GetRefillTimeOk() (*int64, bool)`
GetRefillTimeOk returns a tuple with the RefillTime field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRefillTime
`func (o *TokenBucket) SetRefillTime(v int64)`
SetRefillTime sets RefillTime field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,9 +4,104 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Path** | **string** | | [optional]
**Iommu** | **bool** | | [optional] [default to false]
**Id** | **string** | | [optional]
**Path** | Pointer to **string** | | [optional]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
**Id** | Pointer to **string** | | [optional]
## Methods
### NewVmAddDevice
`func NewVmAddDevice() *VmAddDevice`
NewVmAddDevice instantiates a new VmAddDevice object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVmAddDeviceWithDefaults
`func NewVmAddDeviceWithDefaults() *VmAddDevice`
NewVmAddDeviceWithDefaults instantiates a new VmAddDevice object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetPath
`func (o *VmAddDevice) GetPath() string`
GetPath returns the Path field if non-nil, zero value otherwise.
### GetPathOk
`func (o *VmAddDevice) GetPathOk() (*string, bool)`
GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPath
`func (o *VmAddDevice) SetPath(v string)`
SetPath sets Path field to given value.
### HasPath
`func (o *VmAddDevice) HasPath() bool`
HasPath returns a boolean if a field has been set.
### GetIommu
`func (o *VmAddDevice) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *VmAddDevice) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *VmAddDevice) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *VmAddDevice) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
### GetId
`func (o *VmAddDevice) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *VmAddDevice) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *VmAddDevice) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *VmAddDevice) HasId() bool`
HasId returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,25 +4,525 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cpus** | [**CpusConfig**](CpusConfig.md) | | [optional]
**Memory** | [**MemoryConfig**](MemoryConfig.md) | | [optional]
**Cpus** | Pointer to [**CpusConfig**](CpusConfig.md) | | [optional]
**Memory** | Pointer to [**MemoryConfig**](MemoryConfig.md) | | [optional]
**Kernel** | [**KernelConfig**](KernelConfig.md) | |
**Initramfs** | Pointer to [**InitramfsConfig**](InitramfsConfig.md) | | [optional]
**Cmdline** | [**CmdLineConfig**](CmdLineConfig.md) | | [optional]
**Disks** | [**[]DiskConfig**](DiskConfig.md) | | [optional]
**Net** | [**[]NetConfig**](NetConfig.md) | | [optional]
**Rng** | [**RngConfig**](RngConfig.md) | | [optional]
**Balloon** | [**BalloonConfig**](BalloonConfig.md) | | [optional]
**Fs** | [**[]FsConfig**](FsConfig.md) | | [optional]
**Pmem** | [**[]PmemConfig**](PmemConfig.md) | | [optional]
**Serial** | [**ConsoleConfig**](ConsoleConfig.md) | | [optional]
**Console** | [**ConsoleConfig**](ConsoleConfig.md) | | [optional]
**Devices** | [**[]DeviceConfig**](DeviceConfig.md) | | [optional]
**Vsock** | [**VsockConfig**](VsockConfig.md) | | [optional]
**SgxEpc** | [**[]SgxEpcConfig**](SgxEpcConfig.md) | | [optional]
**Numa** | [**[]NumaConfig**](NumaConfig.md) | | [optional]
**Iommu** | **bool** | | [optional] [default to false]
**Watchdog** | **bool** | | [optional] [default to false]
**Initramfs** | Pointer to [**NullableInitramfsConfig**](InitramfsConfig.md) | | [optional]
**Cmdline** | Pointer to [**CmdLineConfig**](CmdLineConfig.md) | | [optional]
**Disks** | Pointer to [**[]DiskConfig**](DiskConfig.md) | | [optional]
**Net** | Pointer to [**[]NetConfig**](NetConfig.md) | | [optional]
**Rng** | Pointer to [**RngConfig**](RngConfig.md) | | [optional]
**Balloon** | Pointer to [**BalloonConfig**](BalloonConfig.md) | | [optional]
**Fs** | Pointer to [**[]FsConfig**](FsConfig.md) | | [optional]
**Pmem** | Pointer to [**[]PmemConfig**](PmemConfig.md) | | [optional]
**Serial** | Pointer to [**ConsoleConfig**](ConsoleConfig.md) | | [optional]
**Console** | Pointer to [**ConsoleConfig**](ConsoleConfig.md) | | [optional]
**Devices** | Pointer to [**[]DeviceConfig**](DeviceConfig.md) | | [optional]
**Vsock** | Pointer to [**VsockConfig**](VsockConfig.md) | | [optional]
**SgxEpc** | Pointer to [**[]SgxEpcConfig**](SgxEpcConfig.md) | | [optional]
**Numa** | Pointer to [**[]NumaConfig**](NumaConfig.md) | | [optional]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
**Watchdog** | Pointer to **bool** | | [optional] [default to false]
## Methods
### NewVmConfig
`func NewVmConfig(kernel KernelConfig, ) *VmConfig`
NewVmConfig instantiates a new VmConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVmConfigWithDefaults
`func NewVmConfigWithDefaults() *VmConfig`
NewVmConfigWithDefaults instantiates a new VmConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetCpus
`func (o *VmConfig) GetCpus() CpusConfig`
GetCpus returns the Cpus field if non-nil, zero value otherwise.
### GetCpusOk
`func (o *VmConfig) GetCpusOk() (*CpusConfig, bool)`
GetCpusOk returns a tuple with the Cpus field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCpus
`func (o *VmConfig) SetCpus(v CpusConfig)`
SetCpus sets Cpus field to given value.
### HasCpus
`func (o *VmConfig) HasCpus() bool`
HasCpus returns a boolean if a field has been set.
### GetMemory
`func (o *VmConfig) GetMemory() MemoryConfig`
GetMemory returns the Memory field if non-nil, zero value otherwise.
### GetMemoryOk
`func (o *VmConfig) GetMemoryOk() (*MemoryConfig, bool)`
GetMemoryOk returns a tuple with the Memory field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMemory
`func (o *VmConfig) SetMemory(v MemoryConfig)`
SetMemory sets Memory field to given value.
### HasMemory
`func (o *VmConfig) HasMemory() bool`
HasMemory returns a boolean if a field has been set.
### GetKernel
`func (o *VmConfig) GetKernel() KernelConfig`
GetKernel returns the Kernel field if non-nil, zero value otherwise.
### GetKernelOk
`func (o *VmConfig) GetKernelOk() (*KernelConfig, bool)`
GetKernelOk returns a tuple with the Kernel field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetKernel
`func (o *VmConfig) SetKernel(v KernelConfig)`
SetKernel sets Kernel field to given value.
### GetInitramfs
`func (o *VmConfig) GetInitramfs() InitramfsConfig`
GetInitramfs returns the Initramfs field if non-nil, zero value otherwise.
### GetInitramfsOk
`func (o *VmConfig) GetInitramfsOk() (*InitramfsConfig, bool)`
GetInitramfsOk returns a tuple with the Initramfs field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetInitramfs
`func (o *VmConfig) SetInitramfs(v InitramfsConfig)`
SetInitramfs sets Initramfs field to given value.
### HasInitramfs
`func (o *VmConfig) HasInitramfs() bool`
HasInitramfs returns a boolean if a field has been set.
### SetInitramfsNil
`func (o *VmConfig) SetInitramfsNil(b bool)`
SetInitramfsNil sets the value for Initramfs to be an explicit nil
### UnsetInitramfs
`func (o *VmConfig) UnsetInitramfs()`
UnsetInitramfs ensures that no value is present for Initramfs, not even an explicit nil
### GetCmdline
`func (o *VmConfig) GetCmdline() CmdLineConfig`
GetCmdline returns the Cmdline field if non-nil, zero value otherwise.
### GetCmdlineOk
`func (o *VmConfig) GetCmdlineOk() (*CmdLineConfig, bool)`
GetCmdlineOk returns a tuple with the Cmdline field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCmdline
`func (o *VmConfig) SetCmdline(v CmdLineConfig)`
SetCmdline sets Cmdline field to given value.
### HasCmdline
`func (o *VmConfig) HasCmdline() bool`
HasCmdline returns a boolean if a field has been set.
### GetDisks
`func (o *VmConfig) GetDisks() []DiskConfig`
GetDisks returns the Disks field if non-nil, zero value otherwise.
### GetDisksOk
`func (o *VmConfig) GetDisksOk() (*[]DiskConfig, bool)`
GetDisksOk returns a tuple with the Disks field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDisks
`func (o *VmConfig) SetDisks(v []DiskConfig)`
SetDisks sets Disks field to given value.
### HasDisks
`func (o *VmConfig) HasDisks() bool`
HasDisks returns a boolean if a field has been set.
### GetNet
`func (o *VmConfig) GetNet() []NetConfig`
GetNet returns the Net field if non-nil, zero value otherwise.
### GetNetOk
`func (o *VmConfig) GetNetOk() (*[]NetConfig, bool)`
GetNetOk returns a tuple with the Net field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetNet
`func (o *VmConfig) SetNet(v []NetConfig)`
SetNet sets Net field to given value.
### HasNet
`func (o *VmConfig) HasNet() bool`
HasNet returns a boolean if a field has been set.
### GetRng
`func (o *VmConfig) GetRng() RngConfig`
GetRng returns the Rng field if non-nil, zero value otherwise.
### GetRngOk
`func (o *VmConfig) GetRngOk() (*RngConfig, bool)`
GetRngOk returns a tuple with the Rng field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRng
`func (o *VmConfig) SetRng(v RngConfig)`
SetRng sets Rng field to given value.
### HasRng
`func (o *VmConfig) HasRng() bool`
HasRng returns a boolean if a field has been set.
### GetBalloon
`func (o *VmConfig) GetBalloon() BalloonConfig`
GetBalloon returns the Balloon field if non-nil, zero value otherwise.
### GetBalloonOk
`func (o *VmConfig) GetBalloonOk() (*BalloonConfig, bool)`
GetBalloonOk returns a tuple with the Balloon field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetBalloon
`func (o *VmConfig) SetBalloon(v BalloonConfig)`
SetBalloon sets Balloon field to given value.
### HasBalloon
`func (o *VmConfig) HasBalloon() bool`
HasBalloon returns a boolean if a field has been set.
### GetFs
`func (o *VmConfig) GetFs() []FsConfig`
GetFs returns the Fs field if non-nil, zero value otherwise.
### GetFsOk
`func (o *VmConfig) GetFsOk() (*[]FsConfig, bool)`
GetFsOk returns a tuple with the Fs field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetFs
`func (o *VmConfig) SetFs(v []FsConfig)`
SetFs sets Fs field to given value.
### HasFs
`func (o *VmConfig) HasFs() bool`
HasFs returns a boolean if a field has been set.
### GetPmem
`func (o *VmConfig) GetPmem() []PmemConfig`
GetPmem returns the Pmem field if non-nil, zero value otherwise.
### GetPmemOk
`func (o *VmConfig) GetPmemOk() (*[]PmemConfig, bool)`
GetPmemOk returns a tuple with the Pmem field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPmem
`func (o *VmConfig) SetPmem(v []PmemConfig)`
SetPmem sets Pmem field to given value.
### HasPmem
`func (o *VmConfig) HasPmem() bool`
HasPmem returns a boolean if a field has been set.
### GetSerial
`func (o *VmConfig) GetSerial() ConsoleConfig`
GetSerial returns the Serial field if non-nil, zero value otherwise.
### GetSerialOk
`func (o *VmConfig) GetSerialOk() (*ConsoleConfig, bool)`
GetSerialOk returns a tuple with the Serial field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSerial
`func (o *VmConfig) SetSerial(v ConsoleConfig)`
SetSerial sets Serial field to given value.
### HasSerial
`func (o *VmConfig) HasSerial() bool`
HasSerial returns a boolean if a field has been set.
### GetConsole
`func (o *VmConfig) GetConsole() ConsoleConfig`
GetConsole returns the Console field if non-nil, zero value otherwise.
### GetConsoleOk
`func (o *VmConfig) GetConsoleOk() (*ConsoleConfig, bool)`
GetConsoleOk returns a tuple with the Console field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetConsole
`func (o *VmConfig) SetConsole(v ConsoleConfig)`
SetConsole sets Console field to given value.
### HasConsole
`func (o *VmConfig) HasConsole() bool`
HasConsole returns a boolean if a field has been set.
### GetDevices
`func (o *VmConfig) GetDevices() []DeviceConfig`
GetDevices returns the Devices field if non-nil, zero value otherwise.
### GetDevicesOk
`func (o *VmConfig) GetDevicesOk() (*[]DeviceConfig, bool)`
GetDevicesOk returns a tuple with the Devices field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDevices
`func (o *VmConfig) SetDevices(v []DeviceConfig)`
SetDevices sets Devices field to given value.
### HasDevices
`func (o *VmConfig) HasDevices() bool`
HasDevices returns a boolean if a field has been set.
### GetVsock
`func (o *VmConfig) GetVsock() VsockConfig`
GetVsock returns the Vsock field if non-nil, zero value otherwise.
### GetVsockOk
`func (o *VmConfig) GetVsockOk() (*VsockConfig, bool)`
GetVsockOk returns a tuple with the Vsock field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVsock
`func (o *VmConfig) SetVsock(v VsockConfig)`
SetVsock sets Vsock field to given value.
### HasVsock
`func (o *VmConfig) HasVsock() bool`
HasVsock returns a boolean if a field has been set.
### GetSgxEpc
`func (o *VmConfig) GetSgxEpc() []SgxEpcConfig`
GetSgxEpc returns the SgxEpc field if non-nil, zero value otherwise.
### GetSgxEpcOk
`func (o *VmConfig) GetSgxEpcOk() (*[]SgxEpcConfig, bool)`
GetSgxEpcOk returns a tuple with the SgxEpc field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSgxEpc
`func (o *VmConfig) SetSgxEpc(v []SgxEpcConfig)`
SetSgxEpc sets SgxEpc field to given value.
### HasSgxEpc
`func (o *VmConfig) HasSgxEpc() bool`
HasSgxEpc returns a boolean if a field has been set.
### GetNuma
`func (o *VmConfig) GetNuma() []NumaConfig`
GetNuma returns the Numa field if non-nil, zero value otherwise.
### GetNumaOk
`func (o *VmConfig) GetNumaOk() (*[]NumaConfig, bool)`
GetNumaOk returns a tuple with the Numa field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetNuma
`func (o *VmConfig) SetNuma(v []NumaConfig)`
SetNuma sets Numa field to given value.
### HasNuma
`func (o *VmConfig) HasNuma() bool`
HasNuma returns a boolean if a field has been set.
### GetIommu
`func (o *VmConfig) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *VmConfig) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *VmConfig) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *VmConfig) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
### GetWatchdog
`func (o *VmConfig) GetWatchdog() bool`
GetWatchdog returns the Watchdog field if non-nil, zero value otherwise.
### GetWatchdogOk
`func (o *VmConfig) GetWatchdogOk() (*bool, bool)`
GetWatchdogOk returns a tuple with the Watchdog field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetWatchdog
`func (o *VmConfig) SetWatchdog(v bool)`
SetWatchdog sets Watchdog field to given value.
### HasWatchdog
`func (o *VmConfig) HasWatchdog() bool`
HasWatchdog returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,8 +6,118 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Config** | [**VmConfig**](VmConfig.md) | |
**State** | **string** | |
**MemoryActualSize** | **int64** | | [optional]
**DeviceTree** | [**map[string]DeviceNode**](DeviceNode.md) | | [optional]
**MemoryActualSize** | Pointer to **int64** | | [optional]
**DeviceTree** | Pointer to [**map[string]DeviceNode**](DeviceNode.md) | | [optional]
## Methods
### NewVmInfo
`func NewVmInfo(config VmConfig, state string, ) *VmInfo`
NewVmInfo instantiates a new VmInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVmInfoWithDefaults
`func NewVmInfoWithDefaults() *VmInfo`
NewVmInfoWithDefaults instantiates a new VmInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetConfig
`func (o *VmInfo) GetConfig() VmConfig`
GetConfig returns the Config field if non-nil, zero value otherwise.
### GetConfigOk
`func (o *VmInfo) GetConfigOk() (*VmConfig, bool)`
GetConfigOk returns a tuple with the Config field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetConfig
`func (o *VmInfo) SetConfig(v VmConfig)`
SetConfig sets Config field to given value.
### GetState
`func (o *VmInfo) GetState() string`
GetState returns the State field if non-nil, zero value otherwise.
### GetStateOk
`func (o *VmInfo) GetStateOk() (*string, bool)`
GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetState
`func (o *VmInfo) SetState(v string)`
SetState sets State field to given value.
### GetMemoryActualSize
`func (o *VmInfo) GetMemoryActualSize() int64`
GetMemoryActualSize returns the MemoryActualSize field if non-nil, zero value otherwise.
### GetMemoryActualSizeOk
`func (o *VmInfo) GetMemoryActualSizeOk() (*int64, bool)`
GetMemoryActualSizeOk returns a tuple with the MemoryActualSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMemoryActualSize
`func (o *VmInfo) SetMemoryActualSize(v int64)`
SetMemoryActualSize sets MemoryActualSize field to given value.
### HasMemoryActualSize
`func (o *VmInfo) HasMemoryActualSize() bool`
HasMemoryActualSize returns a boolean if a field has been set.
### GetDeviceTree
`func (o *VmInfo) GetDeviceTree() map[string]DeviceNode`
GetDeviceTree returns the DeviceTree field if non-nil, zero value otherwise.
### GetDeviceTreeOk
`func (o *VmInfo) GetDeviceTreeOk() (*map[string]DeviceNode, bool)`
GetDeviceTreeOk returns a tuple with the DeviceTree field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDeviceTree
`func (o *VmInfo) SetDeviceTree(v map[string]DeviceNode)`
SetDeviceTree sets DeviceTree field to given value.
### HasDeviceTree
`func (o *VmInfo) HasDeviceTree() bool`
HasDeviceTree returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,7 +4,52 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | | [optional]
**Id** | Pointer to **string** | | [optional]
## Methods
### NewVmRemoveDevice
`func NewVmRemoveDevice() *VmRemoveDevice`
NewVmRemoveDevice instantiates a new VmRemoveDevice object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVmRemoveDeviceWithDefaults
`func NewVmRemoveDeviceWithDefaults() *VmRemoveDevice`
NewVmRemoveDeviceWithDefaults instantiates a new VmRemoveDevice object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *VmRemoveDevice) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *VmRemoveDevice) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *VmRemoveDevice) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *VmRemoveDevice) HasId() bool`
HasId returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,9 +4,104 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**DesiredVcpus** | **int32** | | [optional]
**DesiredRam** | **int64** | desired memory ram in bytes | [optional]
**DesiredBalloon** | **int64** | desired balloon size in bytes | [optional]
**DesiredVcpus** | Pointer to **int32** | | [optional]
**DesiredRam** | Pointer to **int64** | desired memory ram in bytes | [optional]
**DesiredBalloon** | Pointer to **int64** | desired balloon size in bytes | [optional]
## Methods
### NewVmResize
`func NewVmResize() *VmResize`
NewVmResize instantiates a new VmResize object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVmResizeWithDefaults
`func NewVmResizeWithDefaults() *VmResize`
NewVmResizeWithDefaults instantiates a new VmResize object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetDesiredVcpus
`func (o *VmResize) GetDesiredVcpus() int32`
GetDesiredVcpus returns the DesiredVcpus field if non-nil, zero value otherwise.
### GetDesiredVcpusOk
`func (o *VmResize) GetDesiredVcpusOk() (*int32, bool)`
GetDesiredVcpusOk returns a tuple with the DesiredVcpus field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDesiredVcpus
`func (o *VmResize) SetDesiredVcpus(v int32)`
SetDesiredVcpus sets DesiredVcpus field to given value.
### HasDesiredVcpus
`func (o *VmResize) HasDesiredVcpus() bool`
HasDesiredVcpus returns a boolean if a field has been set.
### GetDesiredRam
`func (o *VmResize) GetDesiredRam() int64`
GetDesiredRam returns the DesiredRam field if non-nil, zero value otherwise.
### GetDesiredRamOk
`func (o *VmResize) GetDesiredRamOk() (*int64, bool)`
GetDesiredRamOk returns a tuple with the DesiredRam field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDesiredRam
`func (o *VmResize) SetDesiredRam(v int64)`
SetDesiredRam sets DesiredRam field to given value.
### HasDesiredRam
`func (o *VmResize) HasDesiredRam() bool`
HasDesiredRam returns a boolean if a field has been set.
### GetDesiredBalloon
`func (o *VmResize) GetDesiredBalloon() int64`
GetDesiredBalloon returns the DesiredBalloon field if non-nil, zero value otherwise.
### GetDesiredBalloonOk
`func (o *VmResize) GetDesiredBalloonOk() (*int64, bool)`
GetDesiredBalloonOk returns a tuple with the DesiredBalloon field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDesiredBalloon
`func (o *VmResize) SetDesiredBalloon(v int64)`
SetDesiredBalloon sets DesiredBalloon field to given value.
### HasDesiredBalloon
`func (o *VmResize) HasDesiredBalloon() bool`
HasDesiredBalloon returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,8 +4,78 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | | [optional]
**DesiredRam** | **int64** | desired memory zone size in bytes | [optional]
**Id** | Pointer to **string** | | [optional]
**DesiredRam** | Pointer to **int64** | desired memory zone size in bytes | [optional]
## Methods
### NewVmResizeZone
`func NewVmResizeZone() *VmResizeZone`
NewVmResizeZone instantiates a new VmResizeZone object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVmResizeZoneWithDefaults
`func NewVmResizeZoneWithDefaults() *VmResizeZone`
NewVmResizeZoneWithDefaults instantiates a new VmResizeZone object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *VmResizeZone) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *VmResizeZone) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *VmResizeZone) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *VmResizeZone) HasId() bool`
HasId returns a boolean if a field has been set.
### GetDesiredRam
`func (o *VmResizeZone) GetDesiredRam() int64`
GetDesiredRam returns the DesiredRam field if non-nil, zero value otherwise.
### GetDesiredRamOk
`func (o *VmResizeZone) GetDesiredRamOk() (*int64, bool)`
GetDesiredRamOk returns a tuple with the DesiredRam field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDesiredRam
`func (o *VmResizeZone) SetDesiredRam(v int64)`
SetDesiredRam sets DesiredRam field to given value.
### HasDesiredRam
`func (o *VmResizeZone) HasDesiredRam() bool`
HasDesiredRam returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,7 +4,52 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**DestinationUrl** | **string** | | [optional]
**DestinationUrl** | Pointer to **string** | | [optional]
## Methods
### NewVmSnapshotConfig
`func NewVmSnapshotConfig() *VmSnapshotConfig`
NewVmSnapshotConfig instantiates a new VmSnapshotConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVmSnapshotConfigWithDefaults
`func NewVmSnapshotConfigWithDefaults() *VmSnapshotConfig`
NewVmSnapshotConfigWithDefaults instantiates a new VmSnapshotConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetDestinationUrl
`func (o *VmSnapshotConfig) GetDestinationUrl() string`
GetDestinationUrl returns the DestinationUrl field if non-nil, zero value otherwise.
### GetDestinationUrlOk
`func (o *VmSnapshotConfig) GetDestinationUrlOk() (*string, bool)`
GetDestinationUrlOk returns a tuple with the DestinationUrl field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDestinationUrl
`func (o *VmSnapshotConfig) SetDestinationUrl(v string)`
SetDestinationUrl sets DestinationUrl field to given value.
### HasDestinationUrl
`func (o *VmSnapshotConfig) HasDestinationUrl() bool`
HasDestinationUrl returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,6 +6,46 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Version** | **string** | |
## Methods
### NewVmmPingResponse
`func NewVmmPingResponse(version string, ) *VmmPingResponse`
NewVmmPingResponse instantiates a new VmmPingResponse object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVmmPingResponseWithDefaults
`func NewVmmPingResponseWithDefaults() *VmmPingResponse`
NewVmmPingResponseWithDefaults instantiates a new VmmPingResponse object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetVersion
`func (o *VmmPingResponse) GetVersion() string`
GetVersion returns the Version field if non-nil, zero value otherwise.
### GetVersionOk
`func (o *VmmPingResponse) GetVersionOk() (*string, bool)`
GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVersion
`func (o *VmmPingResponse) SetVersion(v string)`
SetVersion sets Version field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,8 +6,118 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cid** | **int64** | Guest Vsock CID |
**Socket** | **string** | Path to UNIX domain socket, used to proxy vsock connections. |
**Iommu** | **bool** | | [optional] [default to false]
**Id** | **string** | | [optional]
**Iommu** | Pointer to **bool** | | [optional] [default to false]
**Id** | Pointer to **string** | | [optional]
## Methods
### NewVsockConfig
`func NewVsockConfig(cid int64, socket string, ) *VsockConfig`
NewVsockConfig instantiates a new VsockConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewVsockConfigWithDefaults
`func NewVsockConfigWithDefaults() *VsockConfig`
NewVsockConfigWithDefaults instantiates a new VsockConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetCid
`func (o *VsockConfig) GetCid() int64`
GetCid returns the Cid field if non-nil, zero value otherwise.
### GetCidOk
`func (o *VsockConfig) GetCidOk() (*int64, bool)`
GetCidOk returns a tuple with the Cid field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCid
`func (o *VsockConfig) SetCid(v int64)`
SetCid sets Cid field to given value.
### GetSocket
`func (o *VsockConfig) GetSocket() string`
GetSocket returns the Socket field if non-nil, zero value otherwise.
### GetSocketOk
`func (o *VsockConfig) GetSocketOk() (*string, bool)`
GetSocketOk returns a tuple with the Socket field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSocket
`func (o *VsockConfig) SetSocket(v string)`
SetSocket sets Socket field to given value.
### GetIommu
`func (o *VsockConfig) GetIommu() bool`
GetIommu returns the Iommu field if non-nil, zero value otherwise.
### GetIommuOk
`func (o *VsockConfig) GetIommuOk() (*bool, bool)`
GetIommuOk returns a tuple with the Iommu field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIommu
`func (o *VsockConfig) SetIommu(v bool)`
SetIommu sets Iommu field to given value.
### HasIommu
`func (o *VsockConfig) HasIommu() bool`
HasIommu returns a boolean if a field has been set.
### GetId
`func (o *VsockConfig) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *VsockConfig) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *VsockConfig) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *VsockConfig) HasId() bool`
HasId returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,8 +1,4 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk=
github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=

View File

@@ -1,17 +1,147 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// BalloonConfig struct for BalloonConfig
type BalloonConfig struct {
Size int64 `json:"size"`
// Whether the balloon should deflate when the guest is under memory pressure.
DeflateOnOom bool `json:"deflate_on_oom,omitempty"`
DeflateOnOom *bool `json:"deflate_on_oom,omitempty"`
}
// NewBalloonConfig instantiates a new BalloonConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBalloonConfig(size int64) *BalloonConfig {
this := BalloonConfig{}
this.Size = size
var deflateOnOom bool = false
this.DeflateOnOom = &deflateOnOom
return &this
}
// NewBalloonConfigWithDefaults instantiates a new BalloonConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBalloonConfigWithDefaults() *BalloonConfig {
this := BalloonConfig{}
var deflateOnOom bool = false
this.DeflateOnOom = &deflateOnOom
return &this
}
// GetSize returns the Size field value
func (o *BalloonConfig) GetSize() int64 {
if o == nil {
var ret int64
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *BalloonConfig) GetSizeOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *BalloonConfig) SetSize(v int64) {
o.Size = v
}
// GetDeflateOnOom returns the DeflateOnOom field value if set, zero value otherwise.
func (o *BalloonConfig) GetDeflateOnOom() bool {
if o == nil || o.DeflateOnOom == nil {
var ret bool
return ret
}
return *o.DeflateOnOom
}
// GetDeflateOnOomOk returns a tuple with the DeflateOnOom field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BalloonConfig) GetDeflateOnOomOk() (*bool, bool) {
if o == nil || o.DeflateOnOom == nil {
return nil, false
}
return o.DeflateOnOom, true
}
// HasDeflateOnOom returns a boolean if a field has been set.
func (o *BalloonConfig) HasDeflateOnOom() bool {
if o != nil && o.DeflateOnOom != nil {
return true
}
return false
}
// SetDeflateOnOom gets a reference to the given bool and assigns it to the DeflateOnOom field.
func (o *BalloonConfig) SetDeflateOnOom(v bool) {
o.DeflateOnOom = &v
}
func (o BalloonConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["size"] = o.Size
}
if o.DeflateOnOom != nil {
toSerialize["deflate_on_oom"] = o.DeflateOnOom
}
return json.Marshal(toSerialize)
}
type NullableBalloonConfig struct {
value *BalloonConfig
isSet bool
}
func (v NullableBalloonConfig) Get() *BalloonConfig {
return v.value
}
func (v *NullableBalloonConfig) Set(val *BalloonConfig) {
v.value = val
v.isSet = true
}
func (v NullableBalloonConfig) IsSet() bool {
return v.isSet
}
func (v *NullableBalloonConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBalloonConfig(val *BalloonConfig) *NullableBalloonConfig {
return &NullableBalloonConfig{value: val, isSet: true}
}
func (v NullableBalloonConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBalloonConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,15 +1,106 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// CmdLineConfig struct for CmdLineConfig
type CmdLineConfig struct {
Args string `json:"args"`
}
// NewCmdLineConfig instantiates a new CmdLineConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCmdLineConfig(args string) *CmdLineConfig {
this := CmdLineConfig{}
this.Args = args
return &this
}
// NewCmdLineConfigWithDefaults instantiates a new CmdLineConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCmdLineConfigWithDefaults() *CmdLineConfig {
this := CmdLineConfig{}
return &this
}
// GetArgs returns the Args field value
func (o *CmdLineConfig) GetArgs() string {
if o == nil {
var ret string
return ret
}
return o.Args
}
// GetArgsOk returns a tuple with the Args field value
// and a boolean to check if the value has been set.
func (o *CmdLineConfig) GetArgsOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Args, true
}
// SetArgs sets field value
func (o *CmdLineConfig) SetArgs(v string) {
o.Args = v
}
func (o CmdLineConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["args"] = o.Args
}
return json.Marshal(toSerialize)
}
type NullableCmdLineConfig struct {
value *CmdLineConfig
isSet bool
}
func (v NullableCmdLineConfig) Get() *CmdLineConfig {
return v.value
}
func (v *NullableCmdLineConfig) Set(val *CmdLineConfig) {
v.value = val
v.isSet = true
}
func (v NullableCmdLineConfig) IsSet() bool {
return v.isSet
}
func (v *NullableCmdLineConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCmdLineConfig(val *CmdLineConfig) *NullableCmdLineConfig {
return &NullableCmdLineConfig{value: val, isSet: true}
}
func (v NullableCmdLineConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCmdLineConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,17 +1,182 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// ConsoleConfig struct for ConsoleConfig
type ConsoleConfig struct {
File string `json:"file,omitempty"`
Mode string `json:"mode"`
Iommu bool `json:"iommu,omitempty"`
File *string `json:"file,omitempty"`
Mode string `json:"mode"`
Iommu *bool `json:"iommu,omitempty"`
}
// NewConsoleConfig instantiates a new ConsoleConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewConsoleConfig(mode string) *ConsoleConfig {
this := ConsoleConfig{}
this.Mode = mode
var iommu bool = false
this.Iommu = &iommu
return &this
}
// NewConsoleConfigWithDefaults instantiates a new ConsoleConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewConsoleConfigWithDefaults() *ConsoleConfig {
this := ConsoleConfig{}
var iommu bool = false
this.Iommu = &iommu
return &this
}
// GetFile returns the File field value if set, zero value otherwise.
func (o *ConsoleConfig) GetFile() string {
if o == nil || o.File == nil {
var ret string
return ret
}
return *o.File
}
// GetFileOk returns a tuple with the File field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConsoleConfig) GetFileOk() (*string, bool) {
if o == nil || o.File == nil {
return nil, false
}
return o.File, true
}
// HasFile returns a boolean if a field has been set.
func (o *ConsoleConfig) HasFile() bool {
if o != nil && o.File != nil {
return true
}
return false
}
// SetFile gets a reference to the given string and assigns it to the File field.
func (o *ConsoleConfig) SetFile(v string) {
o.File = &v
}
// GetMode returns the Mode field value
func (o *ConsoleConfig) GetMode() string {
if o == nil {
var ret string
return ret
}
return o.Mode
}
// GetModeOk returns a tuple with the Mode field value
// and a boolean to check if the value has been set.
func (o *ConsoleConfig) GetModeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Mode, true
}
// SetMode sets field value
func (o *ConsoleConfig) SetMode(v string) {
o.Mode = v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *ConsoleConfig) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConsoleConfig) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *ConsoleConfig) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *ConsoleConfig) SetIommu(v bool) {
o.Iommu = &v
}
func (o ConsoleConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.File != nil {
toSerialize["file"] = o.File
}
if true {
toSerialize["mode"] = o.Mode
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
return json.Marshal(toSerialize)
}
type NullableConsoleConfig struct {
value *ConsoleConfig
isSet bool
}
func (v NullableConsoleConfig) Get() *ConsoleConfig {
return v.value
}
func (v *NullableConsoleConfig) Set(val *ConsoleConfig) {
v.value = val
v.isSet = true
}
func (v NullableConsoleConfig) IsSet() bool {
return v.isSet
}
func (v *NullableConsoleConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableConsoleConfig(val *ConsoleConfig) *NullableConsoleConfig {
return &NullableConsoleConfig{value: val, isSet: true}
}
func (v NullableConsoleConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableConsoleConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,18 +1,221 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// CpuTopology struct for CpuTopology
type CpuTopology struct {
ThreadsPerCore int32 `json:"threads_per_core,omitempty"`
CoresPerDie int32 `json:"cores_per_die,omitempty"`
DiesPerPackage int32 `json:"dies_per_package,omitempty"`
Packages int32 `json:"packages,omitempty"`
ThreadsPerCore *int32 `json:"threads_per_core,omitempty"`
CoresPerDie *int32 `json:"cores_per_die,omitempty"`
DiesPerPackage *int32 `json:"dies_per_package,omitempty"`
Packages *int32 `json:"packages,omitempty"`
}
// NewCpuTopology instantiates a new CpuTopology object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCpuTopology() *CpuTopology {
this := CpuTopology{}
return &this
}
// NewCpuTopologyWithDefaults instantiates a new CpuTopology object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCpuTopologyWithDefaults() *CpuTopology {
this := CpuTopology{}
return &this
}
// GetThreadsPerCore returns the ThreadsPerCore field value if set, zero value otherwise.
func (o *CpuTopology) GetThreadsPerCore() int32 {
if o == nil || o.ThreadsPerCore == nil {
var ret int32
return ret
}
return *o.ThreadsPerCore
}
// GetThreadsPerCoreOk returns a tuple with the ThreadsPerCore field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CpuTopology) GetThreadsPerCoreOk() (*int32, bool) {
if o == nil || o.ThreadsPerCore == nil {
return nil, false
}
return o.ThreadsPerCore, true
}
// HasThreadsPerCore returns a boolean if a field has been set.
func (o *CpuTopology) HasThreadsPerCore() bool {
if o != nil && o.ThreadsPerCore != nil {
return true
}
return false
}
// SetThreadsPerCore gets a reference to the given int32 and assigns it to the ThreadsPerCore field.
func (o *CpuTopology) SetThreadsPerCore(v int32) {
o.ThreadsPerCore = &v
}
// GetCoresPerDie returns the CoresPerDie field value if set, zero value otherwise.
func (o *CpuTopology) GetCoresPerDie() int32 {
if o == nil || o.CoresPerDie == nil {
var ret int32
return ret
}
return *o.CoresPerDie
}
// GetCoresPerDieOk returns a tuple with the CoresPerDie field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CpuTopology) GetCoresPerDieOk() (*int32, bool) {
if o == nil || o.CoresPerDie == nil {
return nil, false
}
return o.CoresPerDie, true
}
// HasCoresPerDie returns a boolean if a field has been set.
func (o *CpuTopology) HasCoresPerDie() bool {
if o != nil && o.CoresPerDie != nil {
return true
}
return false
}
// SetCoresPerDie gets a reference to the given int32 and assigns it to the CoresPerDie field.
func (o *CpuTopology) SetCoresPerDie(v int32) {
o.CoresPerDie = &v
}
// GetDiesPerPackage returns the DiesPerPackage field value if set, zero value otherwise.
func (o *CpuTopology) GetDiesPerPackage() int32 {
if o == nil || o.DiesPerPackage == nil {
var ret int32
return ret
}
return *o.DiesPerPackage
}
// GetDiesPerPackageOk returns a tuple with the DiesPerPackage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CpuTopology) GetDiesPerPackageOk() (*int32, bool) {
if o == nil || o.DiesPerPackage == nil {
return nil, false
}
return o.DiesPerPackage, true
}
// HasDiesPerPackage returns a boolean if a field has been set.
func (o *CpuTopology) HasDiesPerPackage() bool {
if o != nil && o.DiesPerPackage != nil {
return true
}
return false
}
// SetDiesPerPackage gets a reference to the given int32 and assigns it to the DiesPerPackage field.
func (o *CpuTopology) SetDiesPerPackage(v int32) {
o.DiesPerPackage = &v
}
// GetPackages returns the Packages field value if set, zero value otherwise.
func (o *CpuTopology) GetPackages() int32 {
if o == nil || o.Packages == nil {
var ret int32
return ret
}
return *o.Packages
}
// GetPackagesOk returns a tuple with the Packages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CpuTopology) GetPackagesOk() (*int32, bool) {
if o == nil || o.Packages == nil {
return nil, false
}
return o.Packages, true
}
// HasPackages returns a boolean if a field has been set.
func (o *CpuTopology) HasPackages() bool {
if o != nil && o.Packages != nil {
return true
}
return false
}
// SetPackages gets a reference to the given int32 and assigns it to the Packages field.
func (o *CpuTopology) SetPackages(v int32) {
o.Packages = &v
}
func (o CpuTopology) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ThreadsPerCore != nil {
toSerialize["threads_per_core"] = o.ThreadsPerCore
}
if o.CoresPerDie != nil {
toSerialize["cores_per_die"] = o.CoresPerDie
}
if o.DiesPerPackage != nil {
toSerialize["dies_per_package"] = o.DiesPerPackage
}
if o.Packages != nil {
toSerialize["packages"] = o.Packages
}
return json.Marshal(toSerialize)
}
type NullableCpuTopology struct {
value *CpuTopology
isSet bool
}
func (v NullableCpuTopology) Get() *CpuTopology {
return v.value
}
func (v *NullableCpuTopology) Set(val *CpuTopology) {
v.value = val
v.isSet = true
}
func (v NullableCpuTopology) IsSet() bool {
return v.isSet
}
func (v *NullableCpuTopology) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCpuTopology(val *CpuTopology) *NullableCpuTopology {
return &NullableCpuTopology{value: val, isSet: true}
}
func (v NullableCpuTopology) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCpuTopology) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,18 +1,211 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// CpusConfig struct for CpusConfig
type CpusConfig struct {
BootVcpus int32 `json:"boot_vcpus"`
MaxVcpus int32 `json:"max_vcpus"`
Topology CpuTopology `json:"topology,omitempty"`
MaxPhysBits int32 `json:"max_phys_bits,omitempty"`
BootVcpus int32 `json:"boot_vcpus"`
MaxVcpus int32 `json:"max_vcpus"`
Topology *CpuTopology `json:"topology,omitempty"`
MaxPhysBits *int32 `json:"max_phys_bits,omitempty"`
}
// NewCpusConfig instantiates a new CpusConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCpusConfig(bootVcpus int32, maxVcpus int32) *CpusConfig {
this := CpusConfig{}
this.BootVcpus = bootVcpus
this.MaxVcpus = maxVcpus
return &this
}
// NewCpusConfigWithDefaults instantiates a new CpusConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCpusConfigWithDefaults() *CpusConfig {
this := CpusConfig{}
var bootVcpus int32 = 1
this.BootVcpus = bootVcpus
var maxVcpus int32 = 1
this.MaxVcpus = maxVcpus
return &this
}
// GetBootVcpus returns the BootVcpus field value
func (o *CpusConfig) GetBootVcpus() int32 {
if o == nil {
var ret int32
return ret
}
return o.BootVcpus
}
// GetBootVcpusOk returns a tuple with the BootVcpus field value
// and a boolean to check if the value has been set.
func (o *CpusConfig) GetBootVcpusOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.BootVcpus, true
}
// SetBootVcpus sets field value
func (o *CpusConfig) SetBootVcpus(v int32) {
o.BootVcpus = v
}
// GetMaxVcpus returns the MaxVcpus field value
func (o *CpusConfig) GetMaxVcpus() int32 {
if o == nil {
var ret int32
return ret
}
return o.MaxVcpus
}
// GetMaxVcpusOk returns a tuple with the MaxVcpus field value
// and a boolean to check if the value has been set.
func (o *CpusConfig) GetMaxVcpusOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.MaxVcpus, true
}
// SetMaxVcpus sets field value
func (o *CpusConfig) SetMaxVcpus(v int32) {
o.MaxVcpus = v
}
// GetTopology returns the Topology field value if set, zero value otherwise.
func (o *CpusConfig) GetTopology() CpuTopology {
if o == nil || o.Topology == nil {
var ret CpuTopology
return ret
}
return *o.Topology
}
// GetTopologyOk returns a tuple with the Topology field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CpusConfig) GetTopologyOk() (*CpuTopology, bool) {
if o == nil || o.Topology == nil {
return nil, false
}
return o.Topology, true
}
// HasTopology returns a boolean if a field has been set.
func (o *CpusConfig) HasTopology() bool {
if o != nil && o.Topology != nil {
return true
}
return false
}
// SetTopology gets a reference to the given CpuTopology and assigns it to the Topology field.
func (o *CpusConfig) SetTopology(v CpuTopology) {
o.Topology = &v
}
// GetMaxPhysBits returns the MaxPhysBits field value if set, zero value otherwise.
func (o *CpusConfig) GetMaxPhysBits() int32 {
if o == nil || o.MaxPhysBits == nil {
var ret int32
return ret
}
return *o.MaxPhysBits
}
// GetMaxPhysBitsOk returns a tuple with the MaxPhysBits field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CpusConfig) GetMaxPhysBitsOk() (*int32, bool) {
if o == nil || o.MaxPhysBits == nil {
return nil, false
}
return o.MaxPhysBits, true
}
// HasMaxPhysBits returns a boolean if a field has been set.
func (o *CpusConfig) HasMaxPhysBits() bool {
if o != nil && o.MaxPhysBits != nil {
return true
}
return false
}
// SetMaxPhysBits gets a reference to the given int32 and assigns it to the MaxPhysBits field.
func (o *CpusConfig) SetMaxPhysBits(v int32) {
o.MaxPhysBits = &v
}
func (o CpusConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["boot_vcpus"] = o.BootVcpus
}
if true {
toSerialize["max_vcpus"] = o.MaxVcpus
}
if o.Topology != nil {
toSerialize["topology"] = o.Topology
}
if o.MaxPhysBits != nil {
toSerialize["max_phys_bits"] = o.MaxPhysBits
}
return json.Marshal(toSerialize)
}
type NullableCpusConfig struct {
value *CpusConfig
isSet bool
}
func (v NullableCpusConfig) Get() *CpusConfig {
return v.value
}
func (v *NullableCpusConfig) Set(val *CpusConfig) {
v.value = val
v.isSet = true
}
func (v NullableCpusConfig) IsSet() bool {
return v.isSet
}
func (v *NullableCpusConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCpusConfig(val *CpusConfig) *NullableCpusConfig {
return &NullableCpusConfig{value: val, isSet: true}
}
func (v NullableCpusConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCpusConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,17 +1,182 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// DeviceConfig struct for DeviceConfig
type DeviceConfig struct {
Path string `json:"path"`
Iommu bool `json:"iommu,omitempty"`
Id string `json:"id,omitempty"`
Path string `json:"path"`
Iommu *bool `json:"iommu,omitempty"`
Id *string `json:"id,omitempty"`
}
// NewDeviceConfig instantiates a new DeviceConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDeviceConfig(path string) *DeviceConfig {
this := DeviceConfig{}
this.Path = path
var iommu bool = false
this.Iommu = &iommu
return &this
}
// NewDeviceConfigWithDefaults instantiates a new DeviceConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDeviceConfigWithDefaults() *DeviceConfig {
this := DeviceConfig{}
var iommu bool = false
this.Iommu = &iommu
return &this
}
// GetPath returns the Path field value
func (o *DeviceConfig) GetPath() string {
if o == nil {
var ret string
return ret
}
return o.Path
}
// GetPathOk returns a tuple with the Path field value
// and a boolean to check if the value has been set.
func (o *DeviceConfig) GetPathOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Path, true
}
// SetPath sets field value
func (o *DeviceConfig) SetPath(v string) {
o.Path = v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *DeviceConfig) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceConfig) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *DeviceConfig) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *DeviceConfig) SetIommu(v bool) {
o.Iommu = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *DeviceConfig) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceConfig) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *DeviceConfig) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *DeviceConfig) SetId(v string) {
o.Id = &v
}
func (o DeviceConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["path"] = o.Path
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
return json.Marshal(toSerialize)
}
type NullableDeviceConfig struct {
value *DeviceConfig
isSet bool
}
func (v NullableDeviceConfig) Get() *DeviceConfig {
return v.value
}
func (v *NullableDeviceConfig) Set(val *DeviceConfig) {
v.value = val
v.isSet = true
}
func (v NullableDeviceConfig) IsSet() bool {
return v.isSet
}
func (v *NullableDeviceConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeviceConfig(val *DeviceConfig) *NullableDeviceConfig {
return &NullableDeviceConfig{value: val, isSet: true}
}
func (v NullableDeviceConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeviceConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,18 +1,221 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// DeviceNode struct for DeviceNode
type DeviceNode struct {
Id string `json:"id,omitempty"`
Resources []map[string]interface{} `json:"resources,omitempty"`
Children []string `json:"children,omitempty"`
PciBdf int32 `json:"pci_bdf,omitempty"`
Id *string `json:"id,omitempty"`
Resources *[]map[string]interface{} `json:"resources,omitempty"`
Children *[]string `json:"children,omitempty"`
PciBdf *int32 `json:"pci_bdf,omitempty"`
}
// NewDeviceNode instantiates a new DeviceNode object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDeviceNode() *DeviceNode {
this := DeviceNode{}
return &this
}
// NewDeviceNodeWithDefaults instantiates a new DeviceNode object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDeviceNodeWithDefaults() *DeviceNode {
this := DeviceNode{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *DeviceNode) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceNode) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *DeviceNode) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *DeviceNode) SetId(v string) {
o.Id = &v
}
// GetResources returns the Resources field value if set, zero value otherwise.
func (o *DeviceNode) GetResources() []map[string]interface{} {
if o == nil || o.Resources == nil {
var ret []map[string]interface{}
return ret
}
return *o.Resources
}
// GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceNode) GetResourcesOk() (*[]map[string]interface{}, bool) {
if o == nil || o.Resources == nil {
return nil, false
}
return o.Resources, true
}
// HasResources returns a boolean if a field has been set.
func (o *DeviceNode) HasResources() bool {
if o != nil && o.Resources != nil {
return true
}
return false
}
// SetResources gets a reference to the given []map[string]interface{} and assigns it to the Resources field.
func (o *DeviceNode) SetResources(v []map[string]interface{}) {
o.Resources = &v
}
// GetChildren returns the Children field value if set, zero value otherwise.
func (o *DeviceNode) GetChildren() []string {
if o == nil || o.Children == nil {
var ret []string
return ret
}
return *o.Children
}
// GetChildrenOk returns a tuple with the Children field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceNode) GetChildrenOk() (*[]string, bool) {
if o == nil || o.Children == nil {
return nil, false
}
return o.Children, true
}
// HasChildren returns a boolean if a field has been set.
func (o *DeviceNode) HasChildren() bool {
if o != nil && o.Children != nil {
return true
}
return false
}
// SetChildren gets a reference to the given []string and assigns it to the Children field.
func (o *DeviceNode) SetChildren(v []string) {
o.Children = &v
}
// GetPciBdf returns the PciBdf field value if set, zero value otherwise.
func (o *DeviceNode) GetPciBdf() int32 {
if o == nil || o.PciBdf == nil {
var ret int32
return ret
}
return *o.PciBdf
}
// GetPciBdfOk returns a tuple with the PciBdf field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceNode) GetPciBdfOk() (*int32, bool) {
if o == nil || o.PciBdf == nil {
return nil, false
}
return o.PciBdf, true
}
// HasPciBdf returns a boolean if a field has been set.
func (o *DeviceNode) HasPciBdf() bool {
if o != nil && o.PciBdf != nil {
return true
}
return false
}
// SetPciBdf gets a reference to the given int32 and assigns it to the PciBdf field.
func (o *DeviceNode) SetPciBdf(v int32) {
o.PciBdf = &v
}
func (o DeviceNode) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Resources != nil {
toSerialize["resources"] = o.Resources
}
if o.Children != nil {
toSerialize["children"] = o.Children
}
if o.PciBdf != nil {
toSerialize["pci_bdf"] = o.PciBdf
}
return json.Marshal(toSerialize)
}
type NullableDeviceNode struct {
value *DeviceNode
isSet bool
}
func (v NullableDeviceNode) Get() *DeviceNode {
return v.value
}
func (v *NullableDeviceNode) Set(val *DeviceNode) {
v.value = val
v.isSet = true
}
func (v NullableDeviceNode) IsSet() bool {
return v.isSet
}
func (v *NullableDeviceNode) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeviceNode(val *DeviceNode) *NullableDeviceNode {
return &NullableDeviceNode{value: val, isSet: true}
}
func (v NullableDeviceNode) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeviceNode) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,25 +1,494 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// DiskConfig struct for DiskConfig
type DiskConfig struct {
Path string `json:"path"`
Readonly bool `json:"readonly,omitempty"`
Direct bool `json:"direct,omitempty"`
Iommu bool `json:"iommu,omitempty"`
NumQueues int32 `json:"num_queues,omitempty"`
QueueSize int32 `json:"queue_size,omitempty"`
VhostUser bool `json:"vhost_user,omitempty"`
VhostSocket string `json:"vhost_socket,omitempty"`
PollQueue bool `json:"poll_queue,omitempty"`
RateLimiterConfig RateLimiterConfig `json:"rate_limiter_config,omitempty"`
Id string `json:"id,omitempty"`
Path string `json:"path"`
Readonly *bool `json:"readonly,omitempty"`
Direct *bool `json:"direct,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
NumQueues *int32 `json:"num_queues,omitempty"`
QueueSize *int32 `json:"queue_size,omitempty"`
VhostUser *bool `json:"vhost_user,omitempty"`
VhostSocket *string `json:"vhost_socket,omitempty"`
PollQueue *bool `json:"poll_queue,omitempty"`
RateLimiterConfig *RateLimiterConfig `json:"rate_limiter_config,omitempty"`
Id *string `json:"id,omitempty"`
}
// NewDiskConfig instantiates a new DiskConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDiskConfig(path string) *DiskConfig {
this := DiskConfig{}
this.Path = path
var readonly bool = false
this.Readonly = &readonly
var direct bool = false
this.Direct = &direct
var iommu bool = false
this.Iommu = &iommu
var numQueues int32 = 1
this.NumQueues = &numQueues
var queueSize int32 = 128
this.QueueSize = &queueSize
var vhostUser bool = false
this.VhostUser = &vhostUser
var pollQueue bool = true
this.PollQueue = &pollQueue
return &this
}
// NewDiskConfigWithDefaults instantiates a new DiskConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDiskConfigWithDefaults() *DiskConfig {
this := DiskConfig{}
var readonly bool = false
this.Readonly = &readonly
var direct bool = false
this.Direct = &direct
var iommu bool = false
this.Iommu = &iommu
var numQueues int32 = 1
this.NumQueues = &numQueues
var queueSize int32 = 128
this.QueueSize = &queueSize
var vhostUser bool = false
this.VhostUser = &vhostUser
var pollQueue bool = true
this.PollQueue = &pollQueue
return &this
}
// GetPath returns the Path field value
func (o *DiskConfig) GetPath() string {
if o == nil {
var ret string
return ret
}
return o.Path
}
// GetPathOk returns a tuple with the Path field value
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetPathOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Path, true
}
// SetPath sets field value
func (o *DiskConfig) SetPath(v string) {
o.Path = v
}
// GetReadonly returns the Readonly field value if set, zero value otherwise.
func (o *DiskConfig) GetReadonly() bool {
if o == nil || o.Readonly == nil {
var ret bool
return ret
}
return *o.Readonly
}
// GetReadonlyOk returns a tuple with the Readonly field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetReadonlyOk() (*bool, bool) {
if o == nil || o.Readonly == nil {
return nil, false
}
return o.Readonly, true
}
// HasReadonly returns a boolean if a field has been set.
func (o *DiskConfig) HasReadonly() bool {
if o != nil && o.Readonly != nil {
return true
}
return false
}
// SetReadonly gets a reference to the given bool and assigns it to the Readonly field.
func (o *DiskConfig) SetReadonly(v bool) {
o.Readonly = &v
}
// GetDirect returns the Direct field value if set, zero value otherwise.
func (o *DiskConfig) GetDirect() bool {
if o == nil || o.Direct == nil {
var ret bool
return ret
}
return *o.Direct
}
// GetDirectOk returns a tuple with the Direct field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetDirectOk() (*bool, bool) {
if o == nil || o.Direct == nil {
return nil, false
}
return o.Direct, true
}
// HasDirect returns a boolean if a field has been set.
func (o *DiskConfig) HasDirect() bool {
if o != nil && o.Direct != nil {
return true
}
return false
}
// SetDirect gets a reference to the given bool and assigns it to the Direct field.
func (o *DiskConfig) SetDirect(v bool) {
o.Direct = &v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *DiskConfig) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *DiskConfig) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *DiskConfig) SetIommu(v bool) {
o.Iommu = &v
}
// GetNumQueues returns the NumQueues field value if set, zero value otherwise.
func (o *DiskConfig) GetNumQueues() int32 {
if o == nil || o.NumQueues == nil {
var ret int32
return ret
}
return *o.NumQueues
}
// GetNumQueuesOk returns a tuple with the NumQueues field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetNumQueuesOk() (*int32, bool) {
if o == nil || o.NumQueues == nil {
return nil, false
}
return o.NumQueues, true
}
// HasNumQueues returns a boolean if a field has been set.
func (o *DiskConfig) HasNumQueues() bool {
if o != nil && o.NumQueues != nil {
return true
}
return false
}
// SetNumQueues gets a reference to the given int32 and assigns it to the NumQueues field.
func (o *DiskConfig) SetNumQueues(v int32) {
o.NumQueues = &v
}
// GetQueueSize returns the QueueSize field value if set, zero value otherwise.
func (o *DiskConfig) GetQueueSize() int32 {
if o == nil || o.QueueSize == nil {
var ret int32
return ret
}
return *o.QueueSize
}
// GetQueueSizeOk returns a tuple with the QueueSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetQueueSizeOk() (*int32, bool) {
if o == nil || o.QueueSize == nil {
return nil, false
}
return o.QueueSize, true
}
// HasQueueSize returns a boolean if a field has been set.
func (o *DiskConfig) HasQueueSize() bool {
if o != nil && o.QueueSize != nil {
return true
}
return false
}
// SetQueueSize gets a reference to the given int32 and assigns it to the QueueSize field.
func (o *DiskConfig) SetQueueSize(v int32) {
o.QueueSize = &v
}
// GetVhostUser returns the VhostUser field value if set, zero value otherwise.
func (o *DiskConfig) GetVhostUser() bool {
if o == nil || o.VhostUser == nil {
var ret bool
return ret
}
return *o.VhostUser
}
// GetVhostUserOk returns a tuple with the VhostUser field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetVhostUserOk() (*bool, bool) {
if o == nil || o.VhostUser == nil {
return nil, false
}
return o.VhostUser, true
}
// HasVhostUser returns a boolean if a field has been set.
func (o *DiskConfig) HasVhostUser() bool {
if o != nil && o.VhostUser != nil {
return true
}
return false
}
// SetVhostUser gets a reference to the given bool and assigns it to the VhostUser field.
func (o *DiskConfig) SetVhostUser(v bool) {
o.VhostUser = &v
}
// GetVhostSocket returns the VhostSocket field value if set, zero value otherwise.
func (o *DiskConfig) GetVhostSocket() string {
if o == nil || o.VhostSocket == nil {
var ret string
return ret
}
return *o.VhostSocket
}
// GetVhostSocketOk returns a tuple with the VhostSocket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetVhostSocketOk() (*string, bool) {
if o == nil || o.VhostSocket == nil {
return nil, false
}
return o.VhostSocket, true
}
// HasVhostSocket returns a boolean if a field has been set.
func (o *DiskConfig) HasVhostSocket() bool {
if o != nil && o.VhostSocket != nil {
return true
}
return false
}
// SetVhostSocket gets a reference to the given string and assigns it to the VhostSocket field.
func (o *DiskConfig) SetVhostSocket(v string) {
o.VhostSocket = &v
}
// GetPollQueue returns the PollQueue field value if set, zero value otherwise.
func (o *DiskConfig) GetPollQueue() bool {
if o == nil || o.PollQueue == nil {
var ret bool
return ret
}
return *o.PollQueue
}
// GetPollQueueOk returns a tuple with the PollQueue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetPollQueueOk() (*bool, bool) {
if o == nil || o.PollQueue == nil {
return nil, false
}
return o.PollQueue, true
}
// HasPollQueue returns a boolean if a field has been set.
func (o *DiskConfig) HasPollQueue() bool {
if o != nil && o.PollQueue != nil {
return true
}
return false
}
// SetPollQueue gets a reference to the given bool and assigns it to the PollQueue field.
func (o *DiskConfig) SetPollQueue(v bool) {
o.PollQueue = &v
}
// GetRateLimiterConfig returns the RateLimiterConfig field value if set, zero value otherwise.
func (o *DiskConfig) GetRateLimiterConfig() RateLimiterConfig {
if o == nil || o.RateLimiterConfig == nil {
var ret RateLimiterConfig
return ret
}
return *o.RateLimiterConfig
}
// GetRateLimiterConfigOk returns a tuple with the RateLimiterConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetRateLimiterConfigOk() (*RateLimiterConfig, bool) {
if o == nil || o.RateLimiterConfig == nil {
return nil, false
}
return o.RateLimiterConfig, true
}
// HasRateLimiterConfig returns a boolean if a field has been set.
func (o *DiskConfig) HasRateLimiterConfig() bool {
if o != nil && o.RateLimiterConfig != nil {
return true
}
return false
}
// SetRateLimiterConfig gets a reference to the given RateLimiterConfig and assigns it to the RateLimiterConfig field.
func (o *DiskConfig) SetRateLimiterConfig(v RateLimiterConfig) {
o.RateLimiterConfig = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *DiskConfig) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskConfig) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *DiskConfig) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *DiskConfig) SetId(v string) {
o.Id = &v
}
func (o DiskConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["path"] = o.Path
}
if o.Readonly != nil {
toSerialize["readonly"] = o.Readonly
}
if o.Direct != nil {
toSerialize["direct"] = o.Direct
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
if o.NumQueues != nil {
toSerialize["num_queues"] = o.NumQueues
}
if o.QueueSize != nil {
toSerialize["queue_size"] = o.QueueSize
}
if o.VhostUser != nil {
toSerialize["vhost_user"] = o.VhostUser
}
if o.VhostSocket != nil {
toSerialize["vhost_socket"] = o.VhostSocket
}
if o.PollQueue != nil {
toSerialize["poll_queue"] = o.PollQueue
}
if o.RateLimiterConfig != nil {
toSerialize["rate_limiter_config"] = o.RateLimiterConfig
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
return json.Marshal(toSerialize)
}
type NullableDiskConfig struct {
value *DiskConfig
isSet bool
}
func (v NullableDiskConfig) Get() *DiskConfig {
return v.value
}
func (v *NullableDiskConfig) Set(val *DiskConfig) {
v.value = val
v.isSet = true
}
func (v NullableDiskConfig) IsSet() bool {
return v.isSet
}
func (v *NullableDiskConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDiskConfig(val *DiskConfig) *NullableDiskConfig {
return &NullableDiskConfig{value: val, isSet: true}
}
func (v NullableDiskConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDiskConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,21 +1,293 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// FsConfig struct for FsConfig
type FsConfig struct {
Tag string `json:"tag"`
Socket string `json:"socket"`
NumQueues int32 `json:"num_queues"`
QueueSize int32 `json:"queue_size"`
Dax bool `json:"dax"`
CacheSize int64 `json:"cache_size"`
Id string `json:"id,omitempty"`
Tag string `json:"tag"`
Socket string `json:"socket"`
NumQueues int32 `json:"num_queues"`
QueueSize int32 `json:"queue_size"`
Dax bool `json:"dax"`
CacheSize int64 `json:"cache_size"`
Id *string `json:"id,omitempty"`
}
// NewFsConfig instantiates a new FsConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewFsConfig(tag string, socket string, numQueues int32, queueSize int32, dax bool, cacheSize int64) *FsConfig {
this := FsConfig{}
this.Tag = tag
this.Socket = socket
this.NumQueues = numQueues
this.QueueSize = queueSize
this.Dax = dax
this.CacheSize = cacheSize
return &this
}
// NewFsConfigWithDefaults instantiates a new FsConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewFsConfigWithDefaults() *FsConfig {
this := FsConfig{}
var numQueues int32 = 1
this.NumQueues = numQueues
var queueSize int32 = 1024
this.QueueSize = queueSize
var dax bool = true
this.Dax = dax
return &this
}
// GetTag returns the Tag field value
func (o *FsConfig) GetTag() string {
if o == nil {
var ret string
return ret
}
return o.Tag
}
// GetTagOk returns a tuple with the Tag field value
// and a boolean to check if the value has been set.
func (o *FsConfig) GetTagOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Tag, true
}
// SetTag sets field value
func (o *FsConfig) SetTag(v string) {
o.Tag = v
}
// GetSocket returns the Socket field value
func (o *FsConfig) GetSocket() string {
if o == nil {
var ret string
return ret
}
return o.Socket
}
// GetSocketOk returns a tuple with the Socket field value
// and a boolean to check if the value has been set.
func (o *FsConfig) GetSocketOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Socket, true
}
// SetSocket sets field value
func (o *FsConfig) SetSocket(v string) {
o.Socket = v
}
// GetNumQueues returns the NumQueues field value
func (o *FsConfig) GetNumQueues() int32 {
if o == nil {
var ret int32
return ret
}
return o.NumQueues
}
// GetNumQueuesOk returns a tuple with the NumQueues field value
// and a boolean to check if the value has been set.
func (o *FsConfig) GetNumQueuesOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.NumQueues, true
}
// SetNumQueues sets field value
func (o *FsConfig) SetNumQueues(v int32) {
o.NumQueues = v
}
// GetQueueSize returns the QueueSize field value
func (o *FsConfig) GetQueueSize() int32 {
if o == nil {
var ret int32
return ret
}
return o.QueueSize
}
// GetQueueSizeOk returns a tuple with the QueueSize field value
// and a boolean to check if the value has been set.
func (o *FsConfig) GetQueueSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.QueueSize, true
}
// SetQueueSize sets field value
func (o *FsConfig) SetQueueSize(v int32) {
o.QueueSize = v
}
// GetDax returns the Dax field value
func (o *FsConfig) GetDax() bool {
if o == nil {
var ret bool
return ret
}
return o.Dax
}
// GetDaxOk returns a tuple with the Dax field value
// and a boolean to check if the value has been set.
func (o *FsConfig) GetDaxOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Dax, true
}
// SetDax sets field value
func (o *FsConfig) SetDax(v bool) {
o.Dax = v
}
// GetCacheSize returns the CacheSize field value
func (o *FsConfig) GetCacheSize() int64 {
if o == nil {
var ret int64
return ret
}
return o.CacheSize
}
// GetCacheSizeOk returns a tuple with the CacheSize field value
// and a boolean to check if the value has been set.
func (o *FsConfig) GetCacheSizeOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.CacheSize, true
}
// SetCacheSize sets field value
func (o *FsConfig) SetCacheSize(v int64) {
o.CacheSize = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *FsConfig) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FsConfig) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *FsConfig) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *FsConfig) SetId(v string) {
o.Id = &v
}
func (o FsConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["tag"] = o.Tag
}
if true {
toSerialize["socket"] = o.Socket
}
if true {
toSerialize["num_queues"] = o.NumQueues
}
if true {
toSerialize["queue_size"] = o.QueueSize
}
if true {
toSerialize["dax"] = o.Dax
}
if true {
toSerialize["cache_size"] = o.CacheSize
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
return json.Marshal(toSerialize)
}
type NullableFsConfig struct {
value *FsConfig
isSet bool
}
func (v NullableFsConfig) Get() *FsConfig {
return v.value
}
func (v *NullableFsConfig) Set(val *FsConfig) {
v.value = val
v.isSet = true
}
func (v NullableFsConfig) IsSet() bool {
return v.isSet
}
func (v *NullableFsConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFsConfig(val *FsConfig) *NullableFsConfig {
return &NullableFsConfig{value: val, isSet: true}
}
func (v NullableFsConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFsConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,15 +1,106 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// InitramfsConfig struct for InitramfsConfig
type InitramfsConfig struct {
Path string `json:"path"`
}
// NewInitramfsConfig instantiates a new InitramfsConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewInitramfsConfig(path string) *InitramfsConfig {
this := InitramfsConfig{}
this.Path = path
return &this
}
// NewInitramfsConfigWithDefaults instantiates a new InitramfsConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewInitramfsConfigWithDefaults() *InitramfsConfig {
this := InitramfsConfig{}
return &this
}
// GetPath returns the Path field value
func (o *InitramfsConfig) GetPath() string {
if o == nil {
var ret string
return ret
}
return o.Path
}
// GetPathOk returns a tuple with the Path field value
// and a boolean to check if the value has been set.
func (o *InitramfsConfig) GetPathOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Path, true
}
// SetPath sets field value
func (o *InitramfsConfig) SetPath(v string) {
o.Path = v
}
func (o InitramfsConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["path"] = o.Path
}
return json.Marshal(toSerialize)
}
type NullableInitramfsConfig struct {
value *InitramfsConfig
isSet bool
}
func (v NullableInitramfsConfig) Get() *InitramfsConfig {
return v.value
}
func (v *NullableInitramfsConfig) Set(val *InitramfsConfig) {
v.value = val
v.isSet = true
}
func (v NullableInitramfsConfig) IsSet() bool {
return v.isSet
}
func (v *NullableInitramfsConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInitramfsConfig(val *InitramfsConfig) *NullableInitramfsConfig {
return &NullableInitramfsConfig{value: val, isSet: true}
}
func (v NullableInitramfsConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInitramfsConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,15 +1,106 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// KernelConfig struct for KernelConfig
type KernelConfig struct {
Path string `json:"path"`
}
// NewKernelConfig instantiates a new KernelConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewKernelConfig(path string) *KernelConfig {
this := KernelConfig{}
this.Path = path
return &this
}
// NewKernelConfigWithDefaults instantiates a new KernelConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewKernelConfigWithDefaults() *KernelConfig {
this := KernelConfig{}
return &this
}
// GetPath returns the Path field value
func (o *KernelConfig) GetPath() string {
if o == nil {
var ret string
return ret
}
return o.Path
}
// GetPathOk returns a tuple with the Path field value
// and a boolean to check if the value has been set.
func (o *KernelConfig) GetPathOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Path, true
}
// SetPath sets field value
func (o *KernelConfig) SetPath(v string) {
o.Path = v
}
func (o KernelConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["path"] = o.Path
}
return json.Marshal(toSerialize)
}
type NullableKernelConfig struct {
value *KernelConfig
isSet bool
}
func (v NullableKernelConfig) Get() *KernelConfig {
return v.value
}
func (v *NullableKernelConfig) Set(val *KernelConfig) {
v.value = val
v.isSet = true
}
func (v NullableKernelConfig) IsSet() bool {
return v.isSet
}
func (v *NullableKernelConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKernelConfig(val *KernelConfig) *NullableKernelConfig {
return &NullableKernelConfig{value: val, isSet: true}
}
func (v NullableKernelConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKernelConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,23 +1,410 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// MemoryConfig struct for MemoryConfig
type MemoryConfig struct {
Size int64 `json:"size"`
HotplugSize int64 `json:"hotplug_size,omitempty"`
HotpluggedSize int64 `json:"hotplugged_size,omitempty"`
Mergeable bool `json:"mergeable,omitempty"`
HotplugMethod string `json:"hotplug_method,omitempty"`
Shared bool `json:"shared,omitempty"`
Hugepages bool `json:"hugepages,omitempty"`
HugepageSize int64 `json:"hugepage_size,omitempty"`
Zones []MemoryZoneConfig `json:"zones,omitempty"`
Size int64 `json:"size"`
HotplugSize *int64 `json:"hotplug_size,omitempty"`
HotpluggedSize *int64 `json:"hotplugged_size,omitempty"`
Mergeable *bool `json:"mergeable,omitempty"`
HotplugMethod *string `json:"hotplug_method,omitempty"`
Shared *bool `json:"shared,omitempty"`
Hugepages *bool `json:"hugepages,omitempty"`
HugepageSize *int64 `json:"hugepage_size,omitempty"`
Zones *[]MemoryZoneConfig `json:"zones,omitempty"`
}
// NewMemoryConfig instantiates a new MemoryConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMemoryConfig(size int64) *MemoryConfig {
this := MemoryConfig{}
this.Size = size
var mergeable bool = false
this.Mergeable = &mergeable
var hotplugMethod string = "Acpi"
this.HotplugMethod = &hotplugMethod
var shared bool = false
this.Shared = &shared
var hugepages bool = false
this.Hugepages = &hugepages
return &this
}
// NewMemoryConfigWithDefaults instantiates a new MemoryConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMemoryConfigWithDefaults() *MemoryConfig {
this := MemoryConfig{}
var mergeable bool = false
this.Mergeable = &mergeable
var hotplugMethod string = "Acpi"
this.HotplugMethod = &hotplugMethod
var shared bool = false
this.Shared = &shared
var hugepages bool = false
this.Hugepages = &hugepages
return &this
}
// GetSize returns the Size field value
func (o *MemoryConfig) GetSize() int64 {
if o == nil {
var ret int64
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetSizeOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *MemoryConfig) SetSize(v int64) {
o.Size = v
}
// GetHotplugSize returns the HotplugSize field value if set, zero value otherwise.
func (o *MemoryConfig) GetHotplugSize() int64 {
if o == nil || o.HotplugSize == nil {
var ret int64
return ret
}
return *o.HotplugSize
}
// GetHotplugSizeOk returns a tuple with the HotplugSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetHotplugSizeOk() (*int64, bool) {
if o == nil || o.HotplugSize == nil {
return nil, false
}
return o.HotplugSize, true
}
// HasHotplugSize returns a boolean if a field has been set.
func (o *MemoryConfig) HasHotplugSize() bool {
if o != nil && o.HotplugSize != nil {
return true
}
return false
}
// SetHotplugSize gets a reference to the given int64 and assigns it to the HotplugSize field.
func (o *MemoryConfig) SetHotplugSize(v int64) {
o.HotplugSize = &v
}
// GetHotpluggedSize returns the HotpluggedSize field value if set, zero value otherwise.
func (o *MemoryConfig) GetHotpluggedSize() int64 {
if o == nil || o.HotpluggedSize == nil {
var ret int64
return ret
}
return *o.HotpluggedSize
}
// GetHotpluggedSizeOk returns a tuple with the HotpluggedSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetHotpluggedSizeOk() (*int64, bool) {
if o == nil || o.HotpluggedSize == nil {
return nil, false
}
return o.HotpluggedSize, true
}
// HasHotpluggedSize returns a boolean if a field has been set.
func (o *MemoryConfig) HasHotpluggedSize() bool {
if o != nil && o.HotpluggedSize != nil {
return true
}
return false
}
// SetHotpluggedSize gets a reference to the given int64 and assigns it to the HotpluggedSize field.
func (o *MemoryConfig) SetHotpluggedSize(v int64) {
o.HotpluggedSize = &v
}
// GetMergeable returns the Mergeable field value if set, zero value otherwise.
func (o *MemoryConfig) GetMergeable() bool {
if o == nil || o.Mergeable == nil {
var ret bool
return ret
}
return *o.Mergeable
}
// GetMergeableOk returns a tuple with the Mergeable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetMergeableOk() (*bool, bool) {
if o == nil || o.Mergeable == nil {
return nil, false
}
return o.Mergeable, true
}
// HasMergeable returns a boolean if a field has been set.
func (o *MemoryConfig) HasMergeable() bool {
if o != nil && o.Mergeable != nil {
return true
}
return false
}
// SetMergeable gets a reference to the given bool and assigns it to the Mergeable field.
func (o *MemoryConfig) SetMergeable(v bool) {
o.Mergeable = &v
}
// GetHotplugMethod returns the HotplugMethod field value if set, zero value otherwise.
func (o *MemoryConfig) GetHotplugMethod() string {
if o == nil || o.HotplugMethod == nil {
var ret string
return ret
}
return *o.HotplugMethod
}
// GetHotplugMethodOk returns a tuple with the HotplugMethod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetHotplugMethodOk() (*string, bool) {
if o == nil || o.HotplugMethod == nil {
return nil, false
}
return o.HotplugMethod, true
}
// HasHotplugMethod returns a boolean if a field has been set.
func (o *MemoryConfig) HasHotplugMethod() bool {
if o != nil && o.HotplugMethod != nil {
return true
}
return false
}
// SetHotplugMethod gets a reference to the given string and assigns it to the HotplugMethod field.
func (o *MemoryConfig) SetHotplugMethod(v string) {
o.HotplugMethod = &v
}
// GetShared returns the Shared field value if set, zero value otherwise.
func (o *MemoryConfig) GetShared() bool {
if o == nil || o.Shared == nil {
var ret bool
return ret
}
return *o.Shared
}
// GetSharedOk returns a tuple with the Shared field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetSharedOk() (*bool, bool) {
if o == nil || o.Shared == nil {
return nil, false
}
return o.Shared, true
}
// HasShared returns a boolean if a field has been set.
func (o *MemoryConfig) HasShared() bool {
if o != nil && o.Shared != nil {
return true
}
return false
}
// SetShared gets a reference to the given bool and assigns it to the Shared field.
func (o *MemoryConfig) SetShared(v bool) {
o.Shared = &v
}
// GetHugepages returns the Hugepages field value if set, zero value otherwise.
func (o *MemoryConfig) GetHugepages() bool {
if o == nil || o.Hugepages == nil {
var ret bool
return ret
}
return *o.Hugepages
}
// GetHugepagesOk returns a tuple with the Hugepages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetHugepagesOk() (*bool, bool) {
if o == nil || o.Hugepages == nil {
return nil, false
}
return o.Hugepages, true
}
// HasHugepages returns a boolean if a field has been set.
func (o *MemoryConfig) HasHugepages() bool {
if o != nil && o.Hugepages != nil {
return true
}
return false
}
// SetHugepages gets a reference to the given bool and assigns it to the Hugepages field.
func (o *MemoryConfig) SetHugepages(v bool) {
o.Hugepages = &v
}
// GetHugepageSize returns the HugepageSize field value if set, zero value otherwise.
func (o *MemoryConfig) GetHugepageSize() int64 {
if o == nil || o.HugepageSize == nil {
var ret int64
return ret
}
return *o.HugepageSize
}
// GetHugepageSizeOk returns a tuple with the HugepageSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetHugepageSizeOk() (*int64, bool) {
if o == nil || o.HugepageSize == nil {
return nil, false
}
return o.HugepageSize, true
}
// HasHugepageSize returns a boolean if a field has been set.
func (o *MemoryConfig) HasHugepageSize() bool {
if o != nil && o.HugepageSize != nil {
return true
}
return false
}
// SetHugepageSize gets a reference to the given int64 and assigns it to the HugepageSize field.
func (o *MemoryConfig) SetHugepageSize(v int64) {
o.HugepageSize = &v
}
// GetZones returns the Zones field value if set, zero value otherwise.
func (o *MemoryConfig) GetZones() []MemoryZoneConfig {
if o == nil || o.Zones == nil {
var ret []MemoryZoneConfig
return ret
}
return *o.Zones
}
// GetZonesOk returns a tuple with the Zones field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetZonesOk() (*[]MemoryZoneConfig, bool) {
if o == nil || o.Zones == nil {
return nil, false
}
return o.Zones, true
}
// HasZones returns a boolean if a field has been set.
func (o *MemoryConfig) HasZones() bool {
if o != nil && o.Zones != nil {
return true
}
return false
}
// SetZones gets a reference to the given []MemoryZoneConfig and assigns it to the Zones field.
func (o *MemoryConfig) SetZones(v []MemoryZoneConfig) {
o.Zones = &v
}
func (o MemoryConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["size"] = o.Size
}
if o.HotplugSize != nil {
toSerialize["hotplug_size"] = o.HotplugSize
}
if o.HotpluggedSize != nil {
toSerialize["hotplugged_size"] = o.HotpluggedSize
}
if o.Mergeable != nil {
toSerialize["mergeable"] = o.Mergeable
}
if o.HotplugMethod != nil {
toSerialize["hotplug_method"] = o.HotplugMethod
}
if o.Shared != nil {
toSerialize["shared"] = o.Shared
}
if o.Hugepages != nil {
toSerialize["hugepages"] = o.Hugepages
}
if o.HugepageSize != nil {
toSerialize["hugepage_size"] = o.HugepageSize
}
if o.Zones != nil {
toSerialize["zones"] = o.Zones
}
return json.Marshal(toSerialize)
}
type NullableMemoryConfig struct {
value *MemoryConfig
isSet bool
}
func (v NullableMemoryConfig) Get() *MemoryConfig {
return v.value
}
func (v *NullableMemoryConfig) Set(val *MemoryConfig) {
v.value = val
v.isSet = true
}
func (v NullableMemoryConfig) IsSet() bool {
return v.isSet
}
func (v *NullableMemoryConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMemoryConfig(val *MemoryConfig) *NullableMemoryConfig {
return &NullableMemoryConfig{value: val, isSet: true}
}
func (v NullableMemoryConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMemoryConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,24 +1,435 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// MemoryZoneConfig struct for MemoryZoneConfig
type MemoryZoneConfig struct {
Id string `json:"id"`
Size int64 `json:"size"`
File string `json:"file,omitempty"`
Mergeable bool `json:"mergeable,omitempty"`
Shared bool `json:"shared,omitempty"`
Hugepages bool `json:"hugepages,omitempty"`
HugepageSize int64 `json:"hugepage_size,omitempty"`
HostNumaNode int32 `json:"host_numa_node,omitempty"`
HotplugSize int64 `json:"hotplug_size,omitempty"`
HotpluggedSize int64 `json:"hotplugged_size,omitempty"`
Id string `json:"id"`
Size int64 `json:"size"`
File *string `json:"file,omitempty"`
Mergeable *bool `json:"mergeable,omitempty"`
Shared *bool `json:"shared,omitempty"`
Hugepages *bool `json:"hugepages,omitempty"`
HugepageSize *int64 `json:"hugepage_size,omitempty"`
HostNumaNode *int32 `json:"host_numa_node,omitempty"`
HotplugSize *int64 `json:"hotplug_size,omitempty"`
HotpluggedSize *int64 `json:"hotplugged_size,omitempty"`
}
// NewMemoryZoneConfig instantiates a new MemoryZoneConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMemoryZoneConfig(id string, size int64) *MemoryZoneConfig {
this := MemoryZoneConfig{}
this.Id = id
this.Size = size
var mergeable bool = false
this.Mergeable = &mergeable
var shared bool = false
this.Shared = &shared
var hugepages bool = false
this.Hugepages = &hugepages
return &this
}
// NewMemoryZoneConfigWithDefaults instantiates a new MemoryZoneConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMemoryZoneConfigWithDefaults() *MemoryZoneConfig {
this := MemoryZoneConfig{}
var mergeable bool = false
this.Mergeable = &mergeable
var shared bool = false
this.Shared = &shared
var hugepages bool = false
this.Hugepages = &hugepages
return &this
}
// GetId returns the Id field value
func (o *MemoryZoneConfig) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *MemoryZoneConfig) SetId(v string) {
o.Id = v
}
// GetSize returns the Size field value
func (o *MemoryZoneConfig) GetSize() int64 {
if o == nil {
var ret int64
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetSizeOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *MemoryZoneConfig) SetSize(v int64) {
o.Size = v
}
// GetFile returns the File field value if set, zero value otherwise.
func (o *MemoryZoneConfig) GetFile() string {
if o == nil || o.File == nil {
var ret string
return ret
}
return *o.File
}
// GetFileOk returns a tuple with the File field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetFileOk() (*string, bool) {
if o == nil || o.File == nil {
return nil, false
}
return o.File, true
}
// HasFile returns a boolean if a field has been set.
func (o *MemoryZoneConfig) HasFile() bool {
if o != nil && o.File != nil {
return true
}
return false
}
// SetFile gets a reference to the given string and assigns it to the File field.
func (o *MemoryZoneConfig) SetFile(v string) {
o.File = &v
}
// GetMergeable returns the Mergeable field value if set, zero value otherwise.
func (o *MemoryZoneConfig) GetMergeable() bool {
if o == nil || o.Mergeable == nil {
var ret bool
return ret
}
return *o.Mergeable
}
// GetMergeableOk returns a tuple with the Mergeable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetMergeableOk() (*bool, bool) {
if o == nil || o.Mergeable == nil {
return nil, false
}
return o.Mergeable, true
}
// HasMergeable returns a boolean if a field has been set.
func (o *MemoryZoneConfig) HasMergeable() bool {
if o != nil && o.Mergeable != nil {
return true
}
return false
}
// SetMergeable gets a reference to the given bool and assigns it to the Mergeable field.
func (o *MemoryZoneConfig) SetMergeable(v bool) {
o.Mergeable = &v
}
// GetShared returns the Shared field value if set, zero value otherwise.
func (o *MemoryZoneConfig) GetShared() bool {
if o == nil || o.Shared == nil {
var ret bool
return ret
}
return *o.Shared
}
// GetSharedOk returns a tuple with the Shared field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetSharedOk() (*bool, bool) {
if o == nil || o.Shared == nil {
return nil, false
}
return o.Shared, true
}
// HasShared returns a boolean if a field has been set.
func (o *MemoryZoneConfig) HasShared() bool {
if o != nil && o.Shared != nil {
return true
}
return false
}
// SetShared gets a reference to the given bool and assigns it to the Shared field.
func (o *MemoryZoneConfig) SetShared(v bool) {
o.Shared = &v
}
// GetHugepages returns the Hugepages field value if set, zero value otherwise.
func (o *MemoryZoneConfig) GetHugepages() bool {
if o == nil || o.Hugepages == nil {
var ret bool
return ret
}
return *o.Hugepages
}
// GetHugepagesOk returns a tuple with the Hugepages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetHugepagesOk() (*bool, bool) {
if o == nil || o.Hugepages == nil {
return nil, false
}
return o.Hugepages, true
}
// HasHugepages returns a boolean if a field has been set.
func (o *MemoryZoneConfig) HasHugepages() bool {
if o != nil && o.Hugepages != nil {
return true
}
return false
}
// SetHugepages gets a reference to the given bool and assigns it to the Hugepages field.
func (o *MemoryZoneConfig) SetHugepages(v bool) {
o.Hugepages = &v
}
// GetHugepageSize returns the HugepageSize field value if set, zero value otherwise.
func (o *MemoryZoneConfig) GetHugepageSize() int64 {
if o == nil || o.HugepageSize == nil {
var ret int64
return ret
}
return *o.HugepageSize
}
// GetHugepageSizeOk returns a tuple with the HugepageSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetHugepageSizeOk() (*int64, bool) {
if o == nil || o.HugepageSize == nil {
return nil, false
}
return o.HugepageSize, true
}
// HasHugepageSize returns a boolean if a field has been set.
func (o *MemoryZoneConfig) HasHugepageSize() bool {
if o != nil && o.HugepageSize != nil {
return true
}
return false
}
// SetHugepageSize gets a reference to the given int64 and assigns it to the HugepageSize field.
func (o *MemoryZoneConfig) SetHugepageSize(v int64) {
o.HugepageSize = &v
}
// GetHostNumaNode returns the HostNumaNode field value if set, zero value otherwise.
func (o *MemoryZoneConfig) GetHostNumaNode() int32 {
if o == nil || o.HostNumaNode == nil {
var ret int32
return ret
}
return *o.HostNumaNode
}
// GetHostNumaNodeOk returns a tuple with the HostNumaNode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetHostNumaNodeOk() (*int32, bool) {
if o == nil || o.HostNumaNode == nil {
return nil, false
}
return o.HostNumaNode, true
}
// HasHostNumaNode returns a boolean if a field has been set.
func (o *MemoryZoneConfig) HasHostNumaNode() bool {
if o != nil && o.HostNumaNode != nil {
return true
}
return false
}
// SetHostNumaNode gets a reference to the given int32 and assigns it to the HostNumaNode field.
func (o *MemoryZoneConfig) SetHostNumaNode(v int32) {
o.HostNumaNode = &v
}
// GetHotplugSize returns the HotplugSize field value if set, zero value otherwise.
func (o *MemoryZoneConfig) GetHotplugSize() int64 {
if o == nil || o.HotplugSize == nil {
var ret int64
return ret
}
return *o.HotplugSize
}
// GetHotplugSizeOk returns a tuple with the HotplugSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetHotplugSizeOk() (*int64, bool) {
if o == nil || o.HotplugSize == nil {
return nil, false
}
return o.HotplugSize, true
}
// HasHotplugSize returns a boolean if a field has been set.
func (o *MemoryZoneConfig) HasHotplugSize() bool {
if o != nil && o.HotplugSize != nil {
return true
}
return false
}
// SetHotplugSize gets a reference to the given int64 and assigns it to the HotplugSize field.
func (o *MemoryZoneConfig) SetHotplugSize(v int64) {
o.HotplugSize = &v
}
// GetHotpluggedSize returns the HotpluggedSize field value if set, zero value otherwise.
func (o *MemoryZoneConfig) GetHotpluggedSize() int64 {
if o == nil || o.HotpluggedSize == nil {
var ret int64
return ret
}
return *o.HotpluggedSize
}
// GetHotpluggedSizeOk returns a tuple with the HotpluggedSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryZoneConfig) GetHotpluggedSizeOk() (*int64, bool) {
if o == nil || o.HotpluggedSize == nil {
return nil, false
}
return o.HotpluggedSize, true
}
// HasHotpluggedSize returns a boolean if a field has been set.
func (o *MemoryZoneConfig) HasHotpluggedSize() bool {
if o != nil && o.HotpluggedSize != nil {
return true
}
return false
}
// SetHotpluggedSize gets a reference to the given int64 and assigns it to the HotpluggedSize field.
func (o *MemoryZoneConfig) SetHotpluggedSize(v int64) {
o.HotpluggedSize = &v
}
func (o MemoryZoneConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["size"] = o.Size
}
if o.File != nil {
toSerialize["file"] = o.File
}
if o.Mergeable != nil {
toSerialize["mergeable"] = o.Mergeable
}
if o.Shared != nil {
toSerialize["shared"] = o.Shared
}
if o.Hugepages != nil {
toSerialize["hugepages"] = o.Hugepages
}
if o.HugepageSize != nil {
toSerialize["hugepage_size"] = o.HugepageSize
}
if o.HostNumaNode != nil {
toSerialize["host_numa_node"] = o.HostNumaNode
}
if o.HotplugSize != nil {
toSerialize["hotplug_size"] = o.HotplugSize
}
if o.HotpluggedSize != nil {
toSerialize["hotplugged_size"] = o.HotpluggedSize
}
return json.Marshal(toSerialize)
}
type NullableMemoryZoneConfig struct {
value *MemoryZoneConfig
isSet bool
}
func (v NullableMemoryZoneConfig) Get() *MemoryZoneConfig {
return v.value
}
func (v *NullableMemoryZoneConfig) Set(val *MemoryZoneConfig) {
v.value = val
v.isSet = true
}
func (v NullableMemoryZoneConfig) IsSet() bool {
return v.isSet
}
func (v *NullableMemoryZoneConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMemoryZoneConfig(val *MemoryZoneConfig) *NullableMemoryZoneConfig {
return &NullableMemoryZoneConfig{value: val, isSet: true}
}
func (v NullableMemoryZoneConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMemoryZoneConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,27 +1,577 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// NetConfig struct for NetConfig
type NetConfig struct {
Tap string `json:"tap,omitempty"`
Ip string `json:"ip,omitempty"`
Mask string `json:"mask,omitempty"`
Mac string `json:"mac,omitempty"`
Iommu bool `json:"iommu,omitempty"`
NumQueues int32 `json:"num_queues,omitempty"`
QueueSize int32 `json:"queue_size,omitempty"`
VhostUser bool `json:"vhost_user,omitempty"`
VhostSocket string `json:"vhost_socket,omitempty"`
VhostMode string `json:"vhost_mode,omitempty"`
Id string `json:"id,omitempty"`
Fd []int32 `json:"fd,omitempty"`
RateLimiterConfig RateLimiterConfig `json:"rate_limiter_config,omitempty"`
Tap *string `json:"tap,omitempty"`
Ip *string `json:"ip,omitempty"`
Mask *string `json:"mask,omitempty"`
Mac *string `json:"mac,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
NumQueues *int32 `json:"num_queues,omitempty"`
QueueSize *int32 `json:"queue_size,omitempty"`
VhostUser *bool `json:"vhost_user,omitempty"`
VhostSocket *string `json:"vhost_socket,omitempty"`
VhostMode *string `json:"vhost_mode,omitempty"`
Id *string `json:"id,omitempty"`
Fd *[]int32 `json:"fd,omitempty"`
RateLimiterConfig *RateLimiterConfig `json:"rate_limiter_config,omitempty"`
}
// NewNetConfig instantiates a new NetConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewNetConfig() *NetConfig {
this := NetConfig{}
var tap string = ""
this.Tap = &tap
var ip string = "192.168.249.1"
this.Ip = &ip
var mask string = "255.255.255.0"
this.Mask = &mask
var iommu bool = false
this.Iommu = &iommu
var numQueues int32 = 2
this.NumQueues = &numQueues
var queueSize int32 = 256
this.QueueSize = &queueSize
var vhostUser bool = false
this.VhostUser = &vhostUser
var vhostMode string = "Client"
this.VhostMode = &vhostMode
return &this
}
// NewNetConfigWithDefaults instantiates a new NetConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewNetConfigWithDefaults() *NetConfig {
this := NetConfig{}
var tap string = ""
this.Tap = &tap
var ip string = "192.168.249.1"
this.Ip = &ip
var mask string = "255.255.255.0"
this.Mask = &mask
var iommu bool = false
this.Iommu = &iommu
var numQueues int32 = 2
this.NumQueues = &numQueues
var queueSize int32 = 256
this.QueueSize = &queueSize
var vhostUser bool = false
this.VhostUser = &vhostUser
var vhostMode string = "Client"
this.VhostMode = &vhostMode
return &this
}
// GetTap returns the Tap field value if set, zero value otherwise.
func (o *NetConfig) GetTap() string {
if o == nil || o.Tap == nil {
var ret string
return ret
}
return *o.Tap
}
// GetTapOk returns a tuple with the Tap field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetTapOk() (*string, bool) {
if o == nil || o.Tap == nil {
return nil, false
}
return o.Tap, true
}
// HasTap returns a boolean if a field has been set.
func (o *NetConfig) HasTap() bool {
if o != nil && o.Tap != nil {
return true
}
return false
}
// SetTap gets a reference to the given string and assigns it to the Tap field.
func (o *NetConfig) SetTap(v string) {
o.Tap = &v
}
// GetIp returns the Ip field value if set, zero value otherwise.
func (o *NetConfig) GetIp() string {
if o == nil || o.Ip == nil {
var ret string
return ret
}
return *o.Ip
}
// GetIpOk returns a tuple with the Ip field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetIpOk() (*string, bool) {
if o == nil || o.Ip == nil {
return nil, false
}
return o.Ip, true
}
// HasIp returns a boolean if a field has been set.
func (o *NetConfig) HasIp() bool {
if o != nil && o.Ip != nil {
return true
}
return false
}
// SetIp gets a reference to the given string and assigns it to the Ip field.
func (o *NetConfig) SetIp(v string) {
o.Ip = &v
}
// GetMask returns the Mask field value if set, zero value otherwise.
func (o *NetConfig) GetMask() string {
if o == nil || o.Mask == nil {
var ret string
return ret
}
return *o.Mask
}
// GetMaskOk returns a tuple with the Mask field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetMaskOk() (*string, bool) {
if o == nil || o.Mask == nil {
return nil, false
}
return o.Mask, true
}
// HasMask returns a boolean if a field has been set.
func (o *NetConfig) HasMask() bool {
if o != nil && o.Mask != nil {
return true
}
return false
}
// SetMask gets a reference to the given string and assigns it to the Mask field.
func (o *NetConfig) SetMask(v string) {
o.Mask = &v
}
// GetMac returns the Mac field value if set, zero value otherwise.
func (o *NetConfig) GetMac() string {
if o == nil || o.Mac == nil {
var ret string
return ret
}
return *o.Mac
}
// GetMacOk returns a tuple with the Mac field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetMacOk() (*string, bool) {
if o == nil || o.Mac == nil {
return nil, false
}
return o.Mac, true
}
// HasMac returns a boolean if a field has been set.
func (o *NetConfig) HasMac() bool {
if o != nil && o.Mac != nil {
return true
}
return false
}
// SetMac gets a reference to the given string and assigns it to the Mac field.
func (o *NetConfig) SetMac(v string) {
o.Mac = &v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *NetConfig) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *NetConfig) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *NetConfig) SetIommu(v bool) {
o.Iommu = &v
}
// GetNumQueues returns the NumQueues field value if set, zero value otherwise.
func (o *NetConfig) GetNumQueues() int32 {
if o == nil || o.NumQueues == nil {
var ret int32
return ret
}
return *o.NumQueues
}
// GetNumQueuesOk returns a tuple with the NumQueues field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetNumQueuesOk() (*int32, bool) {
if o == nil || o.NumQueues == nil {
return nil, false
}
return o.NumQueues, true
}
// HasNumQueues returns a boolean if a field has been set.
func (o *NetConfig) HasNumQueues() bool {
if o != nil && o.NumQueues != nil {
return true
}
return false
}
// SetNumQueues gets a reference to the given int32 and assigns it to the NumQueues field.
func (o *NetConfig) SetNumQueues(v int32) {
o.NumQueues = &v
}
// GetQueueSize returns the QueueSize field value if set, zero value otherwise.
func (o *NetConfig) GetQueueSize() int32 {
if o == nil || o.QueueSize == nil {
var ret int32
return ret
}
return *o.QueueSize
}
// GetQueueSizeOk returns a tuple with the QueueSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetQueueSizeOk() (*int32, bool) {
if o == nil || o.QueueSize == nil {
return nil, false
}
return o.QueueSize, true
}
// HasQueueSize returns a boolean if a field has been set.
func (o *NetConfig) HasQueueSize() bool {
if o != nil && o.QueueSize != nil {
return true
}
return false
}
// SetQueueSize gets a reference to the given int32 and assigns it to the QueueSize field.
func (o *NetConfig) SetQueueSize(v int32) {
o.QueueSize = &v
}
// GetVhostUser returns the VhostUser field value if set, zero value otherwise.
func (o *NetConfig) GetVhostUser() bool {
if o == nil || o.VhostUser == nil {
var ret bool
return ret
}
return *o.VhostUser
}
// GetVhostUserOk returns a tuple with the VhostUser field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetVhostUserOk() (*bool, bool) {
if o == nil || o.VhostUser == nil {
return nil, false
}
return o.VhostUser, true
}
// HasVhostUser returns a boolean if a field has been set.
func (o *NetConfig) HasVhostUser() bool {
if o != nil && o.VhostUser != nil {
return true
}
return false
}
// SetVhostUser gets a reference to the given bool and assigns it to the VhostUser field.
func (o *NetConfig) SetVhostUser(v bool) {
o.VhostUser = &v
}
// GetVhostSocket returns the VhostSocket field value if set, zero value otherwise.
func (o *NetConfig) GetVhostSocket() string {
if o == nil || o.VhostSocket == nil {
var ret string
return ret
}
return *o.VhostSocket
}
// GetVhostSocketOk returns a tuple with the VhostSocket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetVhostSocketOk() (*string, bool) {
if o == nil || o.VhostSocket == nil {
return nil, false
}
return o.VhostSocket, true
}
// HasVhostSocket returns a boolean if a field has been set.
func (o *NetConfig) HasVhostSocket() bool {
if o != nil && o.VhostSocket != nil {
return true
}
return false
}
// SetVhostSocket gets a reference to the given string and assigns it to the VhostSocket field.
func (o *NetConfig) SetVhostSocket(v string) {
o.VhostSocket = &v
}
// GetVhostMode returns the VhostMode field value if set, zero value otherwise.
func (o *NetConfig) GetVhostMode() string {
if o == nil || o.VhostMode == nil {
var ret string
return ret
}
return *o.VhostMode
}
// GetVhostModeOk returns a tuple with the VhostMode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetVhostModeOk() (*string, bool) {
if o == nil || o.VhostMode == nil {
return nil, false
}
return o.VhostMode, true
}
// HasVhostMode returns a boolean if a field has been set.
func (o *NetConfig) HasVhostMode() bool {
if o != nil && o.VhostMode != nil {
return true
}
return false
}
// SetVhostMode gets a reference to the given string and assigns it to the VhostMode field.
func (o *NetConfig) SetVhostMode(v string) {
o.VhostMode = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *NetConfig) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *NetConfig) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *NetConfig) SetId(v string) {
o.Id = &v
}
// GetFd returns the Fd field value if set, zero value otherwise.
func (o *NetConfig) GetFd() []int32 {
if o == nil || o.Fd == nil {
var ret []int32
return ret
}
return *o.Fd
}
// GetFdOk returns a tuple with the Fd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetFdOk() (*[]int32, bool) {
if o == nil || o.Fd == nil {
return nil, false
}
return o.Fd, true
}
// HasFd returns a boolean if a field has been set.
func (o *NetConfig) HasFd() bool {
if o != nil && o.Fd != nil {
return true
}
return false
}
// SetFd gets a reference to the given []int32 and assigns it to the Fd field.
func (o *NetConfig) SetFd(v []int32) {
o.Fd = &v
}
// GetRateLimiterConfig returns the RateLimiterConfig field value if set, zero value otherwise.
func (o *NetConfig) GetRateLimiterConfig() RateLimiterConfig {
if o == nil || o.RateLimiterConfig == nil {
var ret RateLimiterConfig
return ret
}
return *o.RateLimiterConfig
}
// GetRateLimiterConfigOk returns a tuple with the RateLimiterConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetConfig) GetRateLimiterConfigOk() (*RateLimiterConfig, bool) {
if o == nil || o.RateLimiterConfig == nil {
return nil, false
}
return o.RateLimiterConfig, true
}
// HasRateLimiterConfig returns a boolean if a field has been set.
func (o *NetConfig) HasRateLimiterConfig() bool {
if o != nil && o.RateLimiterConfig != nil {
return true
}
return false
}
// SetRateLimiterConfig gets a reference to the given RateLimiterConfig and assigns it to the RateLimiterConfig field.
func (o *NetConfig) SetRateLimiterConfig(v RateLimiterConfig) {
o.RateLimiterConfig = &v
}
func (o NetConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Tap != nil {
toSerialize["tap"] = o.Tap
}
if o.Ip != nil {
toSerialize["ip"] = o.Ip
}
if o.Mask != nil {
toSerialize["mask"] = o.Mask
}
if o.Mac != nil {
toSerialize["mac"] = o.Mac
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
if o.NumQueues != nil {
toSerialize["num_queues"] = o.NumQueues
}
if o.QueueSize != nil {
toSerialize["queue_size"] = o.QueueSize
}
if o.VhostUser != nil {
toSerialize["vhost_user"] = o.VhostUser
}
if o.VhostSocket != nil {
toSerialize["vhost_socket"] = o.VhostSocket
}
if o.VhostMode != nil {
toSerialize["vhost_mode"] = o.VhostMode
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Fd != nil {
toSerialize["fd"] = o.Fd
}
if o.RateLimiterConfig != nil {
toSerialize["rate_limiter_config"] = o.RateLimiterConfig
}
return json.Marshal(toSerialize)
}
type NullableNetConfig struct {
value *NetConfig
isSet bool
}
func (v NullableNetConfig) Get() *NetConfig {
return v.value
}
func (v *NullableNetConfig) Set(val *NetConfig) {
v.value = val
v.isSet = true
}
func (v NullableNetConfig) IsSet() bool {
return v.isSet
}
func (v *NullableNetConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNetConfig(val *NetConfig) *NullableNetConfig {
return &NullableNetConfig{value: val, isSet: true}
}
func (v NullableNetConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNetConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,19 +1,250 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// NumaConfig struct for NumaConfig
type NumaConfig struct {
GuestNumaId int32 `json:"guest_numa_id"`
Cpus []int32 `json:"cpus,omitempty"`
Distances []NumaDistance `json:"distances,omitempty"`
MemoryZones []string `json:"memory_zones,omitempty"`
SgxEpcSections []string `json:"sgx_epc_sections,omitempty"`
GuestNumaId int32 `json:"guest_numa_id"`
Cpus *[]int32 `json:"cpus,omitempty"`
Distances *[]NumaDistance `json:"distances,omitempty"`
MemoryZones *[]string `json:"memory_zones,omitempty"`
SgxEpcSections *[]string `json:"sgx_epc_sections,omitempty"`
}
// NewNumaConfig instantiates a new NumaConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewNumaConfig(guestNumaId int32) *NumaConfig {
this := NumaConfig{}
this.GuestNumaId = guestNumaId
return &this
}
// NewNumaConfigWithDefaults instantiates a new NumaConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewNumaConfigWithDefaults() *NumaConfig {
this := NumaConfig{}
return &this
}
// GetGuestNumaId returns the GuestNumaId field value
func (o *NumaConfig) GetGuestNumaId() int32 {
if o == nil {
var ret int32
return ret
}
return o.GuestNumaId
}
// GetGuestNumaIdOk returns a tuple with the GuestNumaId field value
// and a boolean to check if the value has been set.
func (o *NumaConfig) GetGuestNumaIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.GuestNumaId, true
}
// SetGuestNumaId sets field value
func (o *NumaConfig) SetGuestNumaId(v int32) {
o.GuestNumaId = v
}
// GetCpus returns the Cpus field value if set, zero value otherwise.
func (o *NumaConfig) GetCpus() []int32 {
if o == nil || o.Cpus == nil {
var ret []int32
return ret
}
return *o.Cpus
}
// GetCpusOk returns a tuple with the Cpus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NumaConfig) GetCpusOk() (*[]int32, bool) {
if o == nil || o.Cpus == nil {
return nil, false
}
return o.Cpus, true
}
// HasCpus returns a boolean if a field has been set.
func (o *NumaConfig) HasCpus() bool {
if o != nil && o.Cpus != nil {
return true
}
return false
}
// SetCpus gets a reference to the given []int32 and assigns it to the Cpus field.
func (o *NumaConfig) SetCpus(v []int32) {
o.Cpus = &v
}
// GetDistances returns the Distances field value if set, zero value otherwise.
func (o *NumaConfig) GetDistances() []NumaDistance {
if o == nil || o.Distances == nil {
var ret []NumaDistance
return ret
}
return *o.Distances
}
// GetDistancesOk returns a tuple with the Distances field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NumaConfig) GetDistancesOk() (*[]NumaDistance, bool) {
if o == nil || o.Distances == nil {
return nil, false
}
return o.Distances, true
}
// HasDistances returns a boolean if a field has been set.
func (o *NumaConfig) HasDistances() bool {
if o != nil && o.Distances != nil {
return true
}
return false
}
// SetDistances gets a reference to the given []NumaDistance and assigns it to the Distances field.
func (o *NumaConfig) SetDistances(v []NumaDistance) {
o.Distances = &v
}
// GetMemoryZones returns the MemoryZones field value if set, zero value otherwise.
func (o *NumaConfig) GetMemoryZones() []string {
if o == nil || o.MemoryZones == nil {
var ret []string
return ret
}
return *o.MemoryZones
}
// GetMemoryZonesOk returns a tuple with the MemoryZones field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NumaConfig) GetMemoryZonesOk() (*[]string, bool) {
if o == nil || o.MemoryZones == nil {
return nil, false
}
return o.MemoryZones, true
}
// HasMemoryZones returns a boolean if a field has been set.
func (o *NumaConfig) HasMemoryZones() bool {
if o != nil && o.MemoryZones != nil {
return true
}
return false
}
// SetMemoryZones gets a reference to the given []string and assigns it to the MemoryZones field.
func (o *NumaConfig) SetMemoryZones(v []string) {
o.MemoryZones = &v
}
// GetSgxEpcSections returns the SgxEpcSections field value if set, zero value otherwise.
func (o *NumaConfig) GetSgxEpcSections() []string {
if o == nil || o.SgxEpcSections == nil {
var ret []string
return ret
}
return *o.SgxEpcSections
}
// GetSgxEpcSectionsOk returns a tuple with the SgxEpcSections field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NumaConfig) GetSgxEpcSectionsOk() (*[]string, bool) {
if o == nil || o.SgxEpcSections == nil {
return nil, false
}
return o.SgxEpcSections, true
}
// HasSgxEpcSections returns a boolean if a field has been set.
func (o *NumaConfig) HasSgxEpcSections() bool {
if o != nil && o.SgxEpcSections != nil {
return true
}
return false
}
// SetSgxEpcSections gets a reference to the given []string and assigns it to the SgxEpcSections field.
func (o *NumaConfig) SetSgxEpcSections(v []string) {
o.SgxEpcSections = &v
}
func (o NumaConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["guest_numa_id"] = o.GuestNumaId
}
if o.Cpus != nil {
toSerialize["cpus"] = o.Cpus
}
if o.Distances != nil {
toSerialize["distances"] = o.Distances
}
if o.MemoryZones != nil {
toSerialize["memory_zones"] = o.MemoryZones
}
if o.SgxEpcSections != nil {
toSerialize["sgx_epc_sections"] = o.SgxEpcSections
}
return json.Marshal(toSerialize)
}
type NullableNumaConfig struct {
value *NumaConfig
isSet bool
}
func (v NullableNumaConfig) Get() *NumaConfig {
return v.value
}
func (v *NullableNumaConfig) Set(val *NumaConfig) {
v.value = val
v.isSet = true
}
func (v NullableNumaConfig) IsSet() bool {
return v.isSet
}
func (v *NullableNumaConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNumaConfig(val *NumaConfig) *NullableNumaConfig {
return &NullableNumaConfig{value: val, isSet: true}
}
func (v NullableNumaConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNumaConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,16 +1,135 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// NumaDistance struct for NumaDistance
type NumaDistance struct {
Destination int32 `json:"destination"`
Distance int32 `json:"distance"`
}
// NewNumaDistance instantiates a new NumaDistance object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewNumaDistance(destination int32, distance int32) *NumaDistance {
this := NumaDistance{}
this.Destination = destination
this.Distance = distance
return &this
}
// NewNumaDistanceWithDefaults instantiates a new NumaDistance object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewNumaDistanceWithDefaults() *NumaDistance {
this := NumaDistance{}
return &this
}
// GetDestination returns the Destination field value
func (o *NumaDistance) GetDestination() int32 {
if o == nil {
var ret int32
return ret
}
return o.Destination
}
// GetDestinationOk returns a tuple with the Destination field value
// and a boolean to check if the value has been set.
func (o *NumaDistance) GetDestinationOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Destination, true
}
// SetDestination sets field value
func (o *NumaDistance) SetDestination(v int32) {
o.Destination = v
}
// GetDistance returns the Distance field value
func (o *NumaDistance) GetDistance() int32 {
if o == nil {
var ret int32
return ret
}
return o.Distance
}
// GetDistanceOk returns a tuple with the Distance field value
// and a boolean to check if the value has been set.
func (o *NumaDistance) GetDistanceOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Distance, true
}
// SetDistance sets field value
func (o *NumaDistance) SetDistance(v int32) {
o.Distance = v
}
func (o NumaDistance) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["destination"] = o.Destination
}
if true {
toSerialize["distance"] = o.Distance
}
return json.Marshal(toSerialize)
}
type NullableNumaDistance struct {
value *NumaDistance
isSet bool
}
func (v NullableNumaDistance) Get() *NumaDistance {
return v.value
}
func (v *NullableNumaDistance) Set(val *NumaDistance) {
v.value = val
v.isSet = true
}
func (v NullableNumaDistance) IsSet() bool {
return v.isSet
}
func (v *NullableNumaDistance) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNumaDistance(val *NumaDistance) *NullableNumaDistance {
return &NullableNumaDistance{value: val, isSet: true}
}
func (v NullableNumaDistance) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNumaDistance) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,16 +1,135 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// PciDeviceInfo Information about a PCI device
type PciDeviceInfo struct {
Id string `json:"id"`
Bdf string `json:"bdf"`
}
// NewPciDeviceInfo instantiates a new PciDeviceInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewPciDeviceInfo(id string, bdf string) *PciDeviceInfo {
this := PciDeviceInfo{}
this.Id = id
this.Bdf = bdf
return &this
}
// NewPciDeviceInfoWithDefaults instantiates a new PciDeviceInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewPciDeviceInfoWithDefaults() *PciDeviceInfo {
this := PciDeviceInfo{}
return &this
}
// GetId returns the Id field value
func (o *PciDeviceInfo) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *PciDeviceInfo) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *PciDeviceInfo) SetId(v string) {
o.Id = v
}
// GetBdf returns the Bdf field value
func (o *PciDeviceInfo) GetBdf() string {
if o == nil {
var ret string
return ret
}
return o.Bdf
}
// GetBdfOk returns a tuple with the Bdf field value
// and a boolean to check if the value has been set.
func (o *PciDeviceInfo) GetBdfOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Bdf, true
}
// SetBdf sets field value
func (o *PciDeviceInfo) SetBdf(v string) {
o.Bdf = v
}
func (o PciDeviceInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["bdf"] = o.Bdf
}
return json.Marshal(toSerialize)
}
type NullablePciDeviceInfo struct {
value *PciDeviceInfo
isSet bool
}
func (v NullablePciDeviceInfo) Get() *PciDeviceInfo {
return v.value
}
func (v *NullablePciDeviceInfo) Set(val *PciDeviceInfo) {
v.value = val
v.isSet = true
}
func (v NullablePciDeviceInfo) IsSet() bool {
return v.isSet
}
func (v *NullablePciDeviceInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePciDeviceInfo(val *PciDeviceInfo) *NullablePciDeviceInfo {
return &NullablePciDeviceInfo{value: val, isSet: true}
}
func (v NullablePciDeviceInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePciDeviceInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,20 +1,298 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// PmemConfig struct for PmemConfig
type PmemConfig struct {
File string `json:"file"`
Size int64 `json:"size,omitempty"`
Iommu bool `json:"iommu,omitempty"`
Mergeable bool `json:"mergeable,omitempty"`
DiscardWrites bool `json:"discard_writes,omitempty"`
Id string `json:"id,omitempty"`
File string `json:"file"`
Size *int64 `json:"size,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
Mergeable *bool `json:"mergeable,omitempty"`
DiscardWrites *bool `json:"discard_writes,omitempty"`
Id *string `json:"id,omitempty"`
}
// NewPmemConfig instantiates a new PmemConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewPmemConfig(file string) *PmemConfig {
this := PmemConfig{}
this.File = file
var iommu bool = false
this.Iommu = &iommu
var mergeable bool = false
this.Mergeable = &mergeable
var discardWrites bool = false
this.DiscardWrites = &discardWrites
return &this
}
// NewPmemConfigWithDefaults instantiates a new PmemConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewPmemConfigWithDefaults() *PmemConfig {
this := PmemConfig{}
var iommu bool = false
this.Iommu = &iommu
var mergeable bool = false
this.Mergeable = &mergeable
var discardWrites bool = false
this.DiscardWrites = &discardWrites
return &this
}
// GetFile returns the File field value
func (o *PmemConfig) GetFile() string {
if o == nil {
var ret string
return ret
}
return o.File
}
// GetFileOk returns a tuple with the File field value
// and a boolean to check if the value has been set.
func (o *PmemConfig) GetFileOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.File, true
}
// SetFile sets field value
func (o *PmemConfig) SetFile(v string) {
o.File = v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *PmemConfig) GetSize() int64 {
if o == nil || o.Size == nil {
var ret int64
return ret
}
return *o.Size
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PmemConfig) GetSizeOk() (*int64, bool) {
if o == nil || o.Size == nil {
return nil, false
}
return o.Size, true
}
// HasSize returns a boolean if a field has been set.
func (o *PmemConfig) HasSize() bool {
if o != nil && o.Size != nil {
return true
}
return false
}
// SetSize gets a reference to the given int64 and assigns it to the Size field.
func (o *PmemConfig) SetSize(v int64) {
o.Size = &v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *PmemConfig) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PmemConfig) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *PmemConfig) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *PmemConfig) SetIommu(v bool) {
o.Iommu = &v
}
// GetMergeable returns the Mergeable field value if set, zero value otherwise.
func (o *PmemConfig) GetMergeable() bool {
if o == nil || o.Mergeable == nil {
var ret bool
return ret
}
return *o.Mergeable
}
// GetMergeableOk returns a tuple with the Mergeable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PmemConfig) GetMergeableOk() (*bool, bool) {
if o == nil || o.Mergeable == nil {
return nil, false
}
return o.Mergeable, true
}
// HasMergeable returns a boolean if a field has been set.
func (o *PmemConfig) HasMergeable() bool {
if o != nil && o.Mergeable != nil {
return true
}
return false
}
// SetMergeable gets a reference to the given bool and assigns it to the Mergeable field.
func (o *PmemConfig) SetMergeable(v bool) {
o.Mergeable = &v
}
// GetDiscardWrites returns the DiscardWrites field value if set, zero value otherwise.
func (o *PmemConfig) GetDiscardWrites() bool {
if o == nil || o.DiscardWrites == nil {
var ret bool
return ret
}
return *o.DiscardWrites
}
// GetDiscardWritesOk returns a tuple with the DiscardWrites field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PmemConfig) GetDiscardWritesOk() (*bool, bool) {
if o == nil || o.DiscardWrites == nil {
return nil, false
}
return o.DiscardWrites, true
}
// HasDiscardWrites returns a boolean if a field has been set.
func (o *PmemConfig) HasDiscardWrites() bool {
if o != nil && o.DiscardWrites != nil {
return true
}
return false
}
// SetDiscardWrites gets a reference to the given bool and assigns it to the DiscardWrites field.
func (o *PmemConfig) SetDiscardWrites(v bool) {
o.DiscardWrites = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *PmemConfig) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PmemConfig) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *PmemConfig) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *PmemConfig) SetId(v string) {
o.Id = &v
}
func (o PmemConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["file"] = o.File
}
if o.Size != nil {
toSerialize["size"] = o.Size
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
if o.Mergeable != nil {
toSerialize["mergeable"] = o.Mergeable
}
if o.DiscardWrites != nil {
toSerialize["discard_writes"] = o.DiscardWrites
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
return json.Marshal(toSerialize)
}
type NullablePmemConfig struct {
value *PmemConfig
isSet bool
}
func (v NullablePmemConfig) Get() *PmemConfig {
return v.value
}
func (v *NullablePmemConfig) Set(val *PmemConfig) {
v.value = val
v.isSet = true
}
func (v NullablePmemConfig) IsSet() bool {
return v.isSet
}
func (v *NullablePmemConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePmemConfig(val *PmemConfig) *NullablePmemConfig {
return &NullablePmemConfig{value: val, isSet: true}
}
func (v NullablePmemConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePmemConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,16 +1,149 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// RateLimiterConfig Defines an IO rate limiter with independent bytes/s and ops/s limits. Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
type RateLimiterConfig struct {
Bandwidth TokenBucket `json:"bandwidth,omitempty"`
Ops TokenBucket `json:"ops,omitempty"`
Bandwidth *TokenBucket `json:"bandwidth,omitempty"`
Ops *TokenBucket `json:"ops,omitempty"`
}
// NewRateLimiterConfig instantiates a new RateLimiterConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewRateLimiterConfig() *RateLimiterConfig {
this := RateLimiterConfig{}
return &this
}
// NewRateLimiterConfigWithDefaults instantiates a new RateLimiterConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewRateLimiterConfigWithDefaults() *RateLimiterConfig {
this := RateLimiterConfig{}
return &this
}
// GetBandwidth returns the Bandwidth field value if set, zero value otherwise.
func (o *RateLimiterConfig) GetBandwidth() TokenBucket {
if o == nil || o.Bandwidth == nil {
var ret TokenBucket
return ret
}
return *o.Bandwidth
}
// GetBandwidthOk returns a tuple with the Bandwidth field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RateLimiterConfig) GetBandwidthOk() (*TokenBucket, bool) {
if o == nil || o.Bandwidth == nil {
return nil, false
}
return o.Bandwidth, true
}
// HasBandwidth returns a boolean if a field has been set.
func (o *RateLimiterConfig) HasBandwidth() bool {
if o != nil && o.Bandwidth != nil {
return true
}
return false
}
// SetBandwidth gets a reference to the given TokenBucket and assigns it to the Bandwidth field.
func (o *RateLimiterConfig) SetBandwidth(v TokenBucket) {
o.Bandwidth = &v
}
// GetOps returns the Ops field value if set, zero value otherwise.
func (o *RateLimiterConfig) GetOps() TokenBucket {
if o == nil || o.Ops == nil {
var ret TokenBucket
return ret
}
return *o.Ops
}
// GetOpsOk returns a tuple with the Ops field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RateLimiterConfig) GetOpsOk() (*TokenBucket, bool) {
if o == nil || o.Ops == nil {
return nil, false
}
return o.Ops, true
}
// HasOps returns a boolean if a field has been set.
func (o *RateLimiterConfig) HasOps() bool {
if o != nil && o.Ops != nil {
return true
}
return false
}
// SetOps gets a reference to the given TokenBucket and assigns it to the Ops field.
func (o *RateLimiterConfig) SetOps(v TokenBucket) {
o.Ops = &v
}
func (o RateLimiterConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Bandwidth != nil {
toSerialize["bandwidth"] = o.Bandwidth
}
if o.Ops != nil {
toSerialize["ops"] = o.Ops
}
return json.Marshal(toSerialize)
}
type NullableRateLimiterConfig struct {
value *RateLimiterConfig
isSet bool
}
func (v NullableRateLimiterConfig) Get() *RateLimiterConfig {
return v.value
}
func (v *NullableRateLimiterConfig) Set(val *RateLimiterConfig) {
v.value = val
v.isSet = true
}
func (v NullableRateLimiterConfig) IsSet() bool {
return v.isSet
}
func (v *NullableRateLimiterConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRateLimiterConfig(val *RateLimiterConfig) *NullableRateLimiterConfig {
return &NullableRateLimiterConfig{value: val, isSet: true}
}
func (v NullableRateLimiterConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRateLimiterConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,16 +1,142 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// RestoreConfig struct for RestoreConfig
type RestoreConfig struct {
SourceUrl string `json:"source_url"`
Prefault bool `json:"prefault,omitempty"`
Prefault *bool `json:"prefault,omitempty"`
}
// NewRestoreConfig instantiates a new RestoreConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewRestoreConfig(sourceUrl string) *RestoreConfig {
this := RestoreConfig{}
this.SourceUrl = sourceUrl
return &this
}
// NewRestoreConfigWithDefaults instantiates a new RestoreConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewRestoreConfigWithDefaults() *RestoreConfig {
this := RestoreConfig{}
return &this
}
// GetSourceUrl returns the SourceUrl field value
func (o *RestoreConfig) GetSourceUrl() string {
if o == nil {
var ret string
return ret
}
return o.SourceUrl
}
// GetSourceUrlOk returns a tuple with the SourceUrl field value
// and a boolean to check if the value has been set.
func (o *RestoreConfig) GetSourceUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.SourceUrl, true
}
// SetSourceUrl sets field value
func (o *RestoreConfig) SetSourceUrl(v string) {
o.SourceUrl = v
}
// GetPrefault returns the Prefault field value if set, zero value otherwise.
func (o *RestoreConfig) GetPrefault() bool {
if o == nil || o.Prefault == nil {
var ret bool
return ret
}
return *o.Prefault
}
// GetPrefaultOk returns a tuple with the Prefault field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RestoreConfig) GetPrefaultOk() (*bool, bool) {
if o == nil || o.Prefault == nil {
return nil, false
}
return o.Prefault, true
}
// HasPrefault returns a boolean if a field has been set.
func (o *RestoreConfig) HasPrefault() bool {
if o != nil && o.Prefault != nil {
return true
}
return false
}
// SetPrefault gets a reference to the given bool and assigns it to the Prefault field.
func (o *RestoreConfig) SetPrefault(v bool) {
o.Prefault = &v
}
func (o RestoreConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["source_url"] = o.SourceUrl
}
if o.Prefault != nil {
toSerialize["prefault"] = o.Prefault
}
return json.Marshal(toSerialize)
}
type NullableRestoreConfig struct {
value *RestoreConfig
isSet bool
}
func (v NullableRestoreConfig) Get() *RestoreConfig {
return v.value
}
func (v *NullableRestoreConfig) Set(val *RestoreConfig) {
v.value = val
v.isSet = true
}
func (v NullableRestoreConfig) IsSet() bool {
return v.isSet
}
func (v *NullableRestoreConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRestoreConfig(val *RestoreConfig) *NullableRestoreConfig {
return &NullableRestoreConfig{value: val, isSet: true}
}
func (v NullableRestoreConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRestoreConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,16 +1,148 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// RngConfig struct for RngConfig
type RngConfig struct {
Src string `json:"src"`
Iommu bool `json:"iommu,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
}
// NewRngConfig instantiates a new RngConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewRngConfig(src string) *RngConfig {
this := RngConfig{}
this.Src = src
var iommu bool = false
this.Iommu = &iommu
return &this
}
// NewRngConfigWithDefaults instantiates a new RngConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewRngConfigWithDefaults() *RngConfig {
this := RngConfig{}
var src string = "/dev/urandom"
this.Src = src
var iommu bool = false
this.Iommu = &iommu
return &this
}
// GetSrc returns the Src field value
func (o *RngConfig) GetSrc() string {
if o == nil {
var ret string
return ret
}
return o.Src
}
// GetSrcOk returns a tuple with the Src field value
// and a boolean to check if the value has been set.
func (o *RngConfig) GetSrcOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Src, true
}
// SetSrc sets field value
func (o *RngConfig) SetSrc(v string) {
o.Src = v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *RngConfig) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RngConfig) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *RngConfig) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *RngConfig) SetIommu(v bool) {
o.Iommu = &v
}
func (o RngConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["src"] = o.Src
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
return json.Marshal(toSerialize)
}
type NullableRngConfig struct {
value *RngConfig
isSet bool
}
func (v NullableRngConfig) Get() *RngConfig {
return v.value
}
func (v *NullableRngConfig) Set(val *RngConfig) {
v.value = val
v.isSet = true
}
func (v NullableRngConfig) IsSet() bool {
return v.isSet
}
func (v *NullableRngConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRngConfig(val *RngConfig) *NullableRngConfig {
return &NullableRngConfig{value: val, isSet: true}
}
func (v NullableRngConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRngConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,17 +1,175 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// SgxEpcConfig struct for SgxEpcConfig
type SgxEpcConfig struct {
Id string `json:"id"`
Size int64 `json:"size"`
Prefault bool `json:"prefault,omitempty"`
Prefault *bool `json:"prefault,omitempty"`
}
// NewSgxEpcConfig instantiates a new SgxEpcConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewSgxEpcConfig(id string, size int64) *SgxEpcConfig {
this := SgxEpcConfig{}
this.Id = id
this.Size = size
var prefault bool = false
this.Prefault = &prefault
return &this
}
// NewSgxEpcConfigWithDefaults instantiates a new SgxEpcConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewSgxEpcConfigWithDefaults() *SgxEpcConfig {
this := SgxEpcConfig{}
var prefault bool = false
this.Prefault = &prefault
return &this
}
// GetId returns the Id field value
func (o *SgxEpcConfig) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *SgxEpcConfig) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *SgxEpcConfig) SetId(v string) {
o.Id = v
}
// GetSize returns the Size field value
func (o *SgxEpcConfig) GetSize() int64 {
if o == nil {
var ret int64
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *SgxEpcConfig) GetSizeOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *SgxEpcConfig) SetSize(v int64) {
o.Size = v
}
// GetPrefault returns the Prefault field value if set, zero value otherwise.
func (o *SgxEpcConfig) GetPrefault() bool {
if o == nil || o.Prefault == nil {
var ret bool
return ret
}
return *o.Prefault
}
// GetPrefaultOk returns a tuple with the Prefault field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SgxEpcConfig) GetPrefaultOk() (*bool, bool) {
if o == nil || o.Prefault == nil {
return nil, false
}
return o.Prefault, true
}
// HasPrefault returns a boolean if a field has been set.
func (o *SgxEpcConfig) HasPrefault() bool {
if o != nil && o.Prefault != nil {
return true
}
return false
}
// SetPrefault gets a reference to the given bool and assigns it to the Prefault field.
func (o *SgxEpcConfig) SetPrefault(v bool) {
o.Prefault = &v
}
func (o SgxEpcConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["size"] = o.Size
}
if o.Prefault != nil {
toSerialize["prefault"] = o.Prefault
}
return json.Marshal(toSerialize)
}
type NullableSgxEpcConfig struct {
value *SgxEpcConfig
isSet bool
}
func (v NullableSgxEpcConfig) Get() *SgxEpcConfig {
return v.value
}
func (v *NullableSgxEpcConfig) Set(val *SgxEpcConfig) {
v.value = val
v.isSet = true
}
func (v NullableSgxEpcConfig) IsSet() bool {
return v.isSet
}
func (v *NullableSgxEpcConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSgxEpcConfig(val *SgxEpcConfig) *NullableSgxEpcConfig {
return &NullableSgxEpcConfig{value: val, isSet: true}
}
func (v NullableSgxEpcConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSgxEpcConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,20 +1,174 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// TokenBucket Defines a token bucket with a maximum capacity (_size_), an initial burst size (_one_time_burst_) and an interval for refilling purposes (_refill_time_). The refill-rate is derived from _size_ and _refill_time_, and it is the constant rate at which the tokens replenish. The refill process only starts happening after the initial burst budget is consumed. Consumption from the token bucket is unbounded in speed which allows for bursts bound in size by the amount of tokens available. Once the token bucket is empty, consumption speed is bound by the refill-rate.
type TokenBucket struct {
// The total number of tokens this bucket can hold.
Size int64 `json:"size"`
// The initial size of a token bucket.
OneTimeBurst int64 `json:"one_time_burst,omitempty"`
OneTimeBurst *int64 `json:"one_time_burst,omitempty"`
// The amount of milliseconds it takes for the bucket to refill.
RefillTime int64 `json:"refill_time"`
}
// NewTokenBucket instantiates a new TokenBucket object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTokenBucket(size int64, refillTime int64) *TokenBucket {
this := TokenBucket{}
this.Size = size
this.RefillTime = refillTime
return &this
}
// NewTokenBucketWithDefaults instantiates a new TokenBucket object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTokenBucketWithDefaults() *TokenBucket {
this := TokenBucket{}
return &this
}
// GetSize returns the Size field value
func (o *TokenBucket) GetSize() int64 {
if o == nil {
var ret int64
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *TokenBucket) GetSizeOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *TokenBucket) SetSize(v int64) {
o.Size = v
}
// GetOneTimeBurst returns the OneTimeBurst field value if set, zero value otherwise.
func (o *TokenBucket) GetOneTimeBurst() int64 {
if o == nil || o.OneTimeBurst == nil {
var ret int64
return ret
}
return *o.OneTimeBurst
}
// GetOneTimeBurstOk returns a tuple with the OneTimeBurst field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TokenBucket) GetOneTimeBurstOk() (*int64, bool) {
if o == nil || o.OneTimeBurst == nil {
return nil, false
}
return o.OneTimeBurst, true
}
// HasOneTimeBurst returns a boolean if a field has been set.
func (o *TokenBucket) HasOneTimeBurst() bool {
if o != nil && o.OneTimeBurst != nil {
return true
}
return false
}
// SetOneTimeBurst gets a reference to the given int64 and assigns it to the OneTimeBurst field.
func (o *TokenBucket) SetOneTimeBurst(v int64) {
o.OneTimeBurst = &v
}
// GetRefillTime returns the RefillTime field value
func (o *TokenBucket) GetRefillTime() int64 {
if o == nil {
var ret int64
return ret
}
return o.RefillTime
}
// GetRefillTimeOk returns a tuple with the RefillTime field value
// and a boolean to check if the value has been set.
func (o *TokenBucket) GetRefillTimeOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.RefillTime, true
}
// SetRefillTime sets field value
func (o *TokenBucket) SetRefillTime(v int64) {
o.RefillTime = v
}
func (o TokenBucket) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["size"] = o.Size
}
if o.OneTimeBurst != nil {
toSerialize["one_time_burst"] = o.OneTimeBurst
}
if true {
toSerialize["refill_time"] = o.RefillTime
}
return json.Marshal(toSerialize)
}
type NullableTokenBucket struct {
value *TokenBucket
isSet bool
}
func (v NullableTokenBucket) Get() *TokenBucket {
return v.value
}
func (v *NullableTokenBucket) Set(val *TokenBucket) {
v.value = val
v.isSet = true
}
func (v NullableTokenBucket) IsSet() bool {
return v.isSet
}
func (v *NullableTokenBucket) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTokenBucket(val *TokenBucket) *NullableTokenBucket {
return &NullableTokenBucket{value: val, isSet: true}
}
func (v NullableTokenBucket) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTokenBucket) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,17 +1,189 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VmAddDevice struct for VmAddDevice
type VmAddDevice struct {
Path string `json:"path,omitempty"`
Iommu bool `json:"iommu,omitempty"`
Id string `json:"id,omitempty"`
Path *string `json:"path,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
Id *string `json:"id,omitempty"`
}
// NewVmAddDevice instantiates a new VmAddDevice object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVmAddDevice() *VmAddDevice {
this := VmAddDevice{}
var iommu bool = false
this.Iommu = &iommu
return &this
}
// NewVmAddDeviceWithDefaults instantiates a new VmAddDevice object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVmAddDeviceWithDefaults() *VmAddDevice {
this := VmAddDevice{}
var iommu bool = false
this.Iommu = &iommu
return &this
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *VmAddDevice) GetPath() string {
if o == nil || o.Path == nil {
var ret string
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmAddDevice) GetPathOk() (*string, bool) {
if o == nil || o.Path == nil {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *VmAddDevice) HasPath() bool {
if o != nil && o.Path != nil {
return true
}
return false
}
// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *VmAddDevice) SetPath(v string) {
o.Path = &v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *VmAddDevice) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmAddDevice) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *VmAddDevice) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *VmAddDevice) SetIommu(v bool) {
o.Iommu = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *VmAddDevice) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmAddDevice) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *VmAddDevice) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *VmAddDevice) SetId(v string) {
o.Id = &v
}
func (o VmAddDevice) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Path != nil {
toSerialize["path"] = o.Path
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
return json.Marshal(toSerialize)
}
type NullableVmAddDevice struct {
value *VmAddDevice
isSet bool
}
func (v NullableVmAddDevice) Get() *VmAddDevice {
return v.value
}
func (v *NullableVmAddDevice) Set(val *VmAddDevice) {
v.value = val
v.isSet = true
}
func (v NullableVmAddDevice) IsSet() bool {
return v.isSet
}
func (v *NullableVmAddDevice) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVmAddDevice(val *VmAddDevice) *NullableVmAddDevice {
return &NullableVmAddDevice{value: val, isSet: true}
}
func (v NullableVmAddDevice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVmAddDevice) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,33 +1,773 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VmConfig Virtual machine configuration
type VmConfig struct {
Cpus CpusConfig `json:"cpus,omitempty"`
Memory MemoryConfig `json:"memory,omitempty"`
Kernel KernelConfig `json:"kernel"`
Initramfs *InitramfsConfig `json:"initramfs,omitempty"`
Cmdline CmdLineConfig `json:"cmdline,omitempty"`
Disks []DiskConfig `json:"disks,omitempty"`
Net []NetConfig `json:"net,omitempty"`
Rng RngConfig `json:"rng,omitempty"`
Balloon BalloonConfig `json:"balloon,omitempty"`
Fs []FsConfig `json:"fs,omitempty"`
Pmem []PmemConfig `json:"pmem,omitempty"`
Serial ConsoleConfig `json:"serial,omitempty"`
Console ConsoleConfig `json:"console,omitempty"`
Devices []DeviceConfig `json:"devices,omitempty"`
Vsock VsockConfig `json:"vsock,omitempty"`
SgxEpc []SgxEpcConfig `json:"sgx_epc,omitempty"`
Numa []NumaConfig `json:"numa,omitempty"`
Iommu bool `json:"iommu,omitempty"`
Watchdog bool `json:"watchdog,omitempty"`
Cpus *CpusConfig `json:"cpus,omitempty"`
Memory *MemoryConfig `json:"memory,omitempty"`
Kernel KernelConfig `json:"kernel"`
Initramfs NullableInitramfsConfig `json:"initramfs,omitempty"`
Cmdline *CmdLineConfig `json:"cmdline,omitempty"`
Disks *[]DiskConfig `json:"disks,omitempty"`
Net *[]NetConfig `json:"net,omitempty"`
Rng *RngConfig `json:"rng,omitempty"`
Balloon *BalloonConfig `json:"balloon,omitempty"`
Fs *[]FsConfig `json:"fs,omitempty"`
Pmem *[]PmemConfig `json:"pmem,omitempty"`
Serial *ConsoleConfig `json:"serial,omitempty"`
Console *ConsoleConfig `json:"console,omitempty"`
Devices *[]DeviceConfig `json:"devices,omitempty"`
Vsock *VsockConfig `json:"vsock,omitempty"`
SgxEpc *[]SgxEpcConfig `json:"sgx_epc,omitempty"`
Numa *[]NumaConfig `json:"numa,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
Watchdog *bool `json:"watchdog,omitempty"`
}
// NewVmConfig instantiates a new VmConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVmConfig(kernel KernelConfig) *VmConfig {
this := VmConfig{}
this.Kernel = kernel
var iommu bool = false
this.Iommu = &iommu
var watchdog bool = false
this.Watchdog = &watchdog
return &this
}
// NewVmConfigWithDefaults instantiates a new VmConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVmConfigWithDefaults() *VmConfig {
this := VmConfig{}
var iommu bool = false
this.Iommu = &iommu
var watchdog bool = false
this.Watchdog = &watchdog
return &this
}
// GetCpus returns the Cpus field value if set, zero value otherwise.
func (o *VmConfig) GetCpus() CpusConfig {
if o == nil || o.Cpus == nil {
var ret CpusConfig
return ret
}
return *o.Cpus
}
// GetCpusOk returns a tuple with the Cpus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetCpusOk() (*CpusConfig, bool) {
if o == nil || o.Cpus == nil {
return nil, false
}
return o.Cpus, true
}
// HasCpus returns a boolean if a field has been set.
func (o *VmConfig) HasCpus() bool {
if o != nil && o.Cpus != nil {
return true
}
return false
}
// SetCpus gets a reference to the given CpusConfig and assigns it to the Cpus field.
func (o *VmConfig) SetCpus(v CpusConfig) {
o.Cpus = &v
}
// GetMemory returns the Memory field value if set, zero value otherwise.
func (o *VmConfig) GetMemory() MemoryConfig {
if o == nil || o.Memory == nil {
var ret MemoryConfig
return ret
}
return *o.Memory
}
// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetMemoryOk() (*MemoryConfig, bool) {
if o == nil || o.Memory == nil {
return nil, false
}
return o.Memory, true
}
// HasMemory returns a boolean if a field has been set.
func (o *VmConfig) HasMemory() bool {
if o != nil && o.Memory != nil {
return true
}
return false
}
// SetMemory gets a reference to the given MemoryConfig and assigns it to the Memory field.
func (o *VmConfig) SetMemory(v MemoryConfig) {
o.Memory = &v
}
// GetKernel returns the Kernel field value
func (o *VmConfig) GetKernel() KernelConfig {
if o == nil {
var ret KernelConfig
return ret
}
return o.Kernel
}
// GetKernelOk returns a tuple with the Kernel field value
// and a boolean to check if the value has been set.
func (o *VmConfig) GetKernelOk() (*KernelConfig, bool) {
if o == nil {
return nil, false
}
return &o.Kernel, true
}
// SetKernel sets field value
func (o *VmConfig) SetKernel(v KernelConfig) {
o.Kernel = v
}
// GetInitramfs returns the Initramfs field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *VmConfig) GetInitramfs() InitramfsConfig {
if o == nil || o.Initramfs.Get() == nil {
var ret InitramfsConfig
return ret
}
return *o.Initramfs.Get()
}
// GetInitramfsOk returns a tuple with the Initramfs field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *VmConfig) GetInitramfsOk() (*InitramfsConfig, bool) {
if o == nil {
return nil, false
}
return o.Initramfs.Get(), o.Initramfs.IsSet()
}
// HasInitramfs returns a boolean if a field has been set.
func (o *VmConfig) HasInitramfs() bool {
if o != nil && o.Initramfs.IsSet() {
return true
}
return false
}
// SetInitramfs gets a reference to the given NullableInitramfsConfig and assigns it to the Initramfs field.
func (o *VmConfig) SetInitramfs(v InitramfsConfig) {
o.Initramfs.Set(&v)
}
// SetInitramfsNil sets the value for Initramfs to be an explicit nil
func (o *VmConfig) SetInitramfsNil() {
o.Initramfs.Set(nil)
}
// UnsetInitramfs ensures that no value is present for Initramfs, not even an explicit nil
func (o *VmConfig) UnsetInitramfs() {
o.Initramfs.Unset()
}
// GetCmdline returns the Cmdline field value if set, zero value otherwise.
func (o *VmConfig) GetCmdline() CmdLineConfig {
if o == nil || o.Cmdline == nil {
var ret CmdLineConfig
return ret
}
return *o.Cmdline
}
// GetCmdlineOk returns a tuple with the Cmdline field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetCmdlineOk() (*CmdLineConfig, bool) {
if o == nil || o.Cmdline == nil {
return nil, false
}
return o.Cmdline, true
}
// HasCmdline returns a boolean if a field has been set.
func (o *VmConfig) HasCmdline() bool {
if o != nil && o.Cmdline != nil {
return true
}
return false
}
// SetCmdline gets a reference to the given CmdLineConfig and assigns it to the Cmdline field.
func (o *VmConfig) SetCmdline(v CmdLineConfig) {
o.Cmdline = &v
}
// GetDisks returns the Disks field value if set, zero value otherwise.
func (o *VmConfig) GetDisks() []DiskConfig {
if o == nil || o.Disks == nil {
var ret []DiskConfig
return ret
}
return *o.Disks
}
// GetDisksOk returns a tuple with the Disks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetDisksOk() (*[]DiskConfig, bool) {
if o == nil || o.Disks == nil {
return nil, false
}
return o.Disks, true
}
// HasDisks returns a boolean if a field has been set.
func (o *VmConfig) HasDisks() bool {
if o != nil && o.Disks != nil {
return true
}
return false
}
// SetDisks gets a reference to the given []DiskConfig and assigns it to the Disks field.
func (o *VmConfig) SetDisks(v []DiskConfig) {
o.Disks = &v
}
// GetNet returns the Net field value if set, zero value otherwise.
func (o *VmConfig) GetNet() []NetConfig {
if o == nil || o.Net == nil {
var ret []NetConfig
return ret
}
return *o.Net
}
// GetNetOk returns a tuple with the Net field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetNetOk() (*[]NetConfig, bool) {
if o == nil || o.Net == nil {
return nil, false
}
return o.Net, true
}
// HasNet returns a boolean if a field has been set.
func (o *VmConfig) HasNet() bool {
if o != nil && o.Net != nil {
return true
}
return false
}
// SetNet gets a reference to the given []NetConfig and assigns it to the Net field.
func (o *VmConfig) SetNet(v []NetConfig) {
o.Net = &v
}
// GetRng returns the Rng field value if set, zero value otherwise.
func (o *VmConfig) GetRng() RngConfig {
if o == nil || o.Rng == nil {
var ret RngConfig
return ret
}
return *o.Rng
}
// GetRngOk returns a tuple with the Rng field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetRngOk() (*RngConfig, bool) {
if o == nil || o.Rng == nil {
return nil, false
}
return o.Rng, true
}
// HasRng returns a boolean if a field has been set.
func (o *VmConfig) HasRng() bool {
if o != nil && o.Rng != nil {
return true
}
return false
}
// SetRng gets a reference to the given RngConfig and assigns it to the Rng field.
func (o *VmConfig) SetRng(v RngConfig) {
o.Rng = &v
}
// GetBalloon returns the Balloon field value if set, zero value otherwise.
func (o *VmConfig) GetBalloon() BalloonConfig {
if o == nil || o.Balloon == nil {
var ret BalloonConfig
return ret
}
return *o.Balloon
}
// GetBalloonOk returns a tuple with the Balloon field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetBalloonOk() (*BalloonConfig, bool) {
if o == nil || o.Balloon == nil {
return nil, false
}
return o.Balloon, true
}
// HasBalloon returns a boolean if a field has been set.
func (o *VmConfig) HasBalloon() bool {
if o != nil && o.Balloon != nil {
return true
}
return false
}
// SetBalloon gets a reference to the given BalloonConfig and assigns it to the Balloon field.
func (o *VmConfig) SetBalloon(v BalloonConfig) {
o.Balloon = &v
}
// GetFs returns the Fs field value if set, zero value otherwise.
func (o *VmConfig) GetFs() []FsConfig {
if o == nil || o.Fs == nil {
var ret []FsConfig
return ret
}
return *o.Fs
}
// GetFsOk returns a tuple with the Fs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetFsOk() (*[]FsConfig, bool) {
if o == nil || o.Fs == nil {
return nil, false
}
return o.Fs, true
}
// HasFs returns a boolean if a field has been set.
func (o *VmConfig) HasFs() bool {
if o != nil && o.Fs != nil {
return true
}
return false
}
// SetFs gets a reference to the given []FsConfig and assigns it to the Fs field.
func (o *VmConfig) SetFs(v []FsConfig) {
o.Fs = &v
}
// GetPmem returns the Pmem field value if set, zero value otherwise.
func (o *VmConfig) GetPmem() []PmemConfig {
if o == nil || o.Pmem == nil {
var ret []PmemConfig
return ret
}
return *o.Pmem
}
// GetPmemOk returns a tuple with the Pmem field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetPmemOk() (*[]PmemConfig, bool) {
if o == nil || o.Pmem == nil {
return nil, false
}
return o.Pmem, true
}
// HasPmem returns a boolean if a field has been set.
func (o *VmConfig) HasPmem() bool {
if o != nil && o.Pmem != nil {
return true
}
return false
}
// SetPmem gets a reference to the given []PmemConfig and assigns it to the Pmem field.
func (o *VmConfig) SetPmem(v []PmemConfig) {
o.Pmem = &v
}
// GetSerial returns the Serial field value if set, zero value otherwise.
func (o *VmConfig) GetSerial() ConsoleConfig {
if o == nil || o.Serial == nil {
var ret ConsoleConfig
return ret
}
return *o.Serial
}
// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetSerialOk() (*ConsoleConfig, bool) {
if o == nil || o.Serial == nil {
return nil, false
}
return o.Serial, true
}
// HasSerial returns a boolean if a field has been set.
func (o *VmConfig) HasSerial() bool {
if o != nil && o.Serial != nil {
return true
}
return false
}
// SetSerial gets a reference to the given ConsoleConfig and assigns it to the Serial field.
func (o *VmConfig) SetSerial(v ConsoleConfig) {
o.Serial = &v
}
// GetConsole returns the Console field value if set, zero value otherwise.
func (o *VmConfig) GetConsole() ConsoleConfig {
if o == nil || o.Console == nil {
var ret ConsoleConfig
return ret
}
return *o.Console
}
// GetConsoleOk returns a tuple with the Console field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetConsoleOk() (*ConsoleConfig, bool) {
if o == nil || o.Console == nil {
return nil, false
}
return o.Console, true
}
// HasConsole returns a boolean if a field has been set.
func (o *VmConfig) HasConsole() bool {
if o != nil && o.Console != nil {
return true
}
return false
}
// SetConsole gets a reference to the given ConsoleConfig and assigns it to the Console field.
func (o *VmConfig) SetConsole(v ConsoleConfig) {
o.Console = &v
}
// GetDevices returns the Devices field value if set, zero value otherwise.
func (o *VmConfig) GetDevices() []DeviceConfig {
if o == nil || o.Devices == nil {
var ret []DeviceConfig
return ret
}
return *o.Devices
}
// GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetDevicesOk() (*[]DeviceConfig, bool) {
if o == nil || o.Devices == nil {
return nil, false
}
return o.Devices, true
}
// HasDevices returns a boolean if a field has been set.
func (o *VmConfig) HasDevices() bool {
if o != nil && o.Devices != nil {
return true
}
return false
}
// SetDevices gets a reference to the given []DeviceConfig and assigns it to the Devices field.
func (o *VmConfig) SetDevices(v []DeviceConfig) {
o.Devices = &v
}
// GetVsock returns the Vsock field value if set, zero value otherwise.
func (o *VmConfig) GetVsock() VsockConfig {
if o == nil || o.Vsock == nil {
var ret VsockConfig
return ret
}
return *o.Vsock
}
// GetVsockOk returns a tuple with the Vsock field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetVsockOk() (*VsockConfig, bool) {
if o == nil || o.Vsock == nil {
return nil, false
}
return o.Vsock, true
}
// HasVsock returns a boolean if a field has been set.
func (o *VmConfig) HasVsock() bool {
if o != nil && o.Vsock != nil {
return true
}
return false
}
// SetVsock gets a reference to the given VsockConfig and assigns it to the Vsock field.
func (o *VmConfig) SetVsock(v VsockConfig) {
o.Vsock = &v
}
// GetSgxEpc returns the SgxEpc field value if set, zero value otherwise.
func (o *VmConfig) GetSgxEpc() []SgxEpcConfig {
if o == nil || o.SgxEpc == nil {
var ret []SgxEpcConfig
return ret
}
return *o.SgxEpc
}
// GetSgxEpcOk returns a tuple with the SgxEpc field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetSgxEpcOk() (*[]SgxEpcConfig, bool) {
if o == nil || o.SgxEpc == nil {
return nil, false
}
return o.SgxEpc, true
}
// HasSgxEpc returns a boolean if a field has been set.
func (o *VmConfig) HasSgxEpc() bool {
if o != nil && o.SgxEpc != nil {
return true
}
return false
}
// SetSgxEpc gets a reference to the given []SgxEpcConfig and assigns it to the SgxEpc field.
func (o *VmConfig) SetSgxEpc(v []SgxEpcConfig) {
o.SgxEpc = &v
}
// GetNuma returns the Numa field value if set, zero value otherwise.
func (o *VmConfig) GetNuma() []NumaConfig {
if o == nil || o.Numa == nil {
var ret []NumaConfig
return ret
}
return *o.Numa
}
// GetNumaOk returns a tuple with the Numa field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetNumaOk() (*[]NumaConfig, bool) {
if o == nil || o.Numa == nil {
return nil, false
}
return o.Numa, true
}
// HasNuma returns a boolean if a field has been set.
func (o *VmConfig) HasNuma() bool {
if o != nil && o.Numa != nil {
return true
}
return false
}
// SetNuma gets a reference to the given []NumaConfig and assigns it to the Numa field.
func (o *VmConfig) SetNuma(v []NumaConfig) {
o.Numa = &v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *VmConfig) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *VmConfig) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *VmConfig) SetIommu(v bool) {
o.Iommu = &v
}
// GetWatchdog returns the Watchdog field value if set, zero value otherwise.
func (o *VmConfig) GetWatchdog() bool {
if o == nil || o.Watchdog == nil {
var ret bool
return ret
}
return *o.Watchdog
}
// GetWatchdogOk returns a tuple with the Watchdog field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetWatchdogOk() (*bool, bool) {
if o == nil || o.Watchdog == nil {
return nil, false
}
return o.Watchdog, true
}
// HasWatchdog returns a boolean if a field has been set.
func (o *VmConfig) HasWatchdog() bool {
if o != nil && o.Watchdog != nil {
return true
}
return false
}
// SetWatchdog gets a reference to the given bool and assigns it to the Watchdog field.
func (o *VmConfig) SetWatchdog(v bool) {
o.Watchdog = &v
}
func (o VmConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Cpus != nil {
toSerialize["cpus"] = o.Cpus
}
if o.Memory != nil {
toSerialize["memory"] = o.Memory
}
if true {
toSerialize["kernel"] = o.Kernel
}
if o.Initramfs.IsSet() {
toSerialize["initramfs"] = o.Initramfs.Get()
}
if o.Cmdline != nil {
toSerialize["cmdline"] = o.Cmdline
}
if o.Disks != nil {
toSerialize["disks"] = o.Disks
}
if o.Net != nil {
toSerialize["net"] = o.Net
}
if o.Rng != nil {
toSerialize["rng"] = o.Rng
}
if o.Balloon != nil {
toSerialize["balloon"] = o.Balloon
}
if o.Fs != nil {
toSerialize["fs"] = o.Fs
}
if o.Pmem != nil {
toSerialize["pmem"] = o.Pmem
}
if o.Serial != nil {
toSerialize["serial"] = o.Serial
}
if o.Console != nil {
toSerialize["console"] = o.Console
}
if o.Devices != nil {
toSerialize["devices"] = o.Devices
}
if o.Vsock != nil {
toSerialize["vsock"] = o.Vsock
}
if o.SgxEpc != nil {
toSerialize["sgx_epc"] = o.SgxEpc
}
if o.Numa != nil {
toSerialize["numa"] = o.Numa
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
if o.Watchdog != nil {
toSerialize["watchdog"] = o.Watchdog
}
return json.Marshal(toSerialize)
}
type NullableVmConfig struct {
value *VmConfig
isSet bool
}
func (v NullableVmConfig) Get() *VmConfig {
return v.value
}
func (v *NullableVmConfig) Set(val *VmConfig) {
v.value = val
v.isSet = true
}
func (v NullableVmConfig) IsSet() bool {
return v.isSet
}
func (v *NullableVmConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVmConfig(val *VmConfig) *NullableVmConfig {
return &NullableVmConfig{value: val, isSet: true}
}
func (v NullableVmConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVmConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,18 +1,207 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VmInfo Virtual Machine information
type VmInfo struct {
Config VmConfig `json:"config"`
State string `json:"state"`
MemoryActualSize int64 `json:"memory_actual_size,omitempty"`
DeviceTree map[string]DeviceNode `json:"device_tree,omitempty"`
Config VmConfig `json:"config"`
State string `json:"state"`
MemoryActualSize *int64 `json:"memory_actual_size,omitempty"`
DeviceTree *map[string]DeviceNode `json:"device_tree,omitempty"`
}
// NewVmInfo instantiates a new VmInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVmInfo(config VmConfig, state string) *VmInfo {
this := VmInfo{}
this.Config = config
this.State = state
return &this
}
// NewVmInfoWithDefaults instantiates a new VmInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVmInfoWithDefaults() *VmInfo {
this := VmInfo{}
return &this
}
// GetConfig returns the Config field value
func (o *VmInfo) GetConfig() VmConfig {
if o == nil {
var ret VmConfig
return ret
}
return o.Config
}
// GetConfigOk returns a tuple with the Config field value
// and a boolean to check if the value has been set.
func (o *VmInfo) GetConfigOk() (*VmConfig, bool) {
if o == nil {
return nil, false
}
return &o.Config, true
}
// SetConfig sets field value
func (o *VmInfo) SetConfig(v VmConfig) {
o.Config = v
}
// GetState returns the State field value
func (o *VmInfo) GetState() string {
if o == nil {
var ret string
return ret
}
return o.State
}
// GetStateOk returns a tuple with the State field value
// and a boolean to check if the value has been set.
func (o *VmInfo) GetStateOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.State, true
}
// SetState sets field value
func (o *VmInfo) SetState(v string) {
o.State = v
}
// GetMemoryActualSize returns the MemoryActualSize field value if set, zero value otherwise.
func (o *VmInfo) GetMemoryActualSize() int64 {
if o == nil || o.MemoryActualSize == nil {
var ret int64
return ret
}
return *o.MemoryActualSize
}
// GetMemoryActualSizeOk returns a tuple with the MemoryActualSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmInfo) GetMemoryActualSizeOk() (*int64, bool) {
if o == nil || o.MemoryActualSize == nil {
return nil, false
}
return o.MemoryActualSize, true
}
// HasMemoryActualSize returns a boolean if a field has been set.
func (o *VmInfo) HasMemoryActualSize() bool {
if o != nil && o.MemoryActualSize != nil {
return true
}
return false
}
// SetMemoryActualSize gets a reference to the given int64 and assigns it to the MemoryActualSize field.
func (o *VmInfo) SetMemoryActualSize(v int64) {
o.MemoryActualSize = &v
}
// GetDeviceTree returns the DeviceTree field value if set, zero value otherwise.
func (o *VmInfo) GetDeviceTree() map[string]DeviceNode {
if o == nil || o.DeviceTree == nil {
var ret map[string]DeviceNode
return ret
}
return *o.DeviceTree
}
// GetDeviceTreeOk returns a tuple with the DeviceTree field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmInfo) GetDeviceTreeOk() (*map[string]DeviceNode, bool) {
if o == nil || o.DeviceTree == nil {
return nil, false
}
return o.DeviceTree, true
}
// HasDeviceTree returns a boolean if a field has been set.
func (o *VmInfo) HasDeviceTree() bool {
if o != nil && o.DeviceTree != nil {
return true
}
return false
}
// SetDeviceTree gets a reference to the given map[string]DeviceNode and assigns it to the DeviceTree field.
func (o *VmInfo) SetDeviceTree(v map[string]DeviceNode) {
o.DeviceTree = &v
}
func (o VmInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["config"] = o.Config
}
if true {
toSerialize["state"] = o.State
}
if o.MemoryActualSize != nil {
toSerialize["memory_actual_size"] = o.MemoryActualSize
}
if o.DeviceTree != nil {
toSerialize["device_tree"] = o.DeviceTree
}
return json.Marshal(toSerialize)
}
type NullableVmInfo struct {
value *VmInfo
isSet bool
}
func (v NullableVmInfo) Get() *VmInfo {
return v.value
}
func (v *NullableVmInfo) Set(val *VmInfo) {
v.value = val
v.isSet = true
}
func (v NullableVmInfo) IsSet() bool {
return v.isSet
}
func (v *NullableVmInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVmInfo(val *VmInfo) *NullableVmInfo {
return &NullableVmInfo{value: val, isSet: true}
}
func (v NullableVmInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVmInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,15 +1,113 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VmRemoveDevice struct for VmRemoveDevice
type VmRemoveDevice struct {
Id string `json:"id,omitempty"`
Id *string `json:"id,omitempty"`
}
// NewVmRemoveDevice instantiates a new VmRemoveDevice object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVmRemoveDevice() *VmRemoveDevice {
this := VmRemoveDevice{}
return &this
}
// NewVmRemoveDeviceWithDefaults instantiates a new VmRemoveDevice object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVmRemoveDeviceWithDefaults() *VmRemoveDevice {
this := VmRemoveDevice{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *VmRemoveDevice) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmRemoveDevice) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *VmRemoveDevice) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *VmRemoveDevice) SetId(v string) {
o.Id = &v
}
func (o VmRemoveDevice) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
return json.Marshal(toSerialize)
}
type NullableVmRemoveDevice struct {
value *VmRemoveDevice
isSet bool
}
func (v NullableVmRemoveDevice) Get() *VmRemoveDevice {
return v.value
}
func (v *NullableVmRemoveDevice) Set(val *VmRemoveDevice) {
v.value = val
v.isSet = true
}
func (v NullableVmRemoveDevice) IsSet() bool {
return v.isSet
}
func (v *NullableVmRemoveDevice) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVmRemoveDevice(val *VmRemoveDevice) *NullableVmRemoveDevice {
return &NullableVmRemoveDevice{value: val, isSet: true}
}
func (v NullableVmRemoveDevice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVmRemoveDevice) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,19 +1,187 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VmResize struct for VmResize
type VmResize struct {
DesiredVcpus int32 `json:"desired_vcpus,omitempty"`
DesiredVcpus *int32 `json:"desired_vcpus,omitempty"`
// desired memory ram in bytes
DesiredRam int64 `json:"desired_ram,omitempty"`
DesiredRam *int64 `json:"desired_ram,omitempty"`
// desired balloon size in bytes
DesiredBalloon int64 `json:"desired_balloon,omitempty"`
DesiredBalloon *int64 `json:"desired_balloon,omitempty"`
}
// NewVmResize instantiates a new VmResize object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVmResize() *VmResize {
this := VmResize{}
return &this
}
// NewVmResizeWithDefaults instantiates a new VmResize object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVmResizeWithDefaults() *VmResize {
this := VmResize{}
return &this
}
// GetDesiredVcpus returns the DesiredVcpus field value if set, zero value otherwise.
func (o *VmResize) GetDesiredVcpus() int32 {
if o == nil || o.DesiredVcpus == nil {
var ret int32
return ret
}
return *o.DesiredVcpus
}
// GetDesiredVcpusOk returns a tuple with the DesiredVcpus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmResize) GetDesiredVcpusOk() (*int32, bool) {
if o == nil || o.DesiredVcpus == nil {
return nil, false
}
return o.DesiredVcpus, true
}
// HasDesiredVcpus returns a boolean if a field has been set.
func (o *VmResize) HasDesiredVcpus() bool {
if o != nil && o.DesiredVcpus != nil {
return true
}
return false
}
// SetDesiredVcpus gets a reference to the given int32 and assigns it to the DesiredVcpus field.
func (o *VmResize) SetDesiredVcpus(v int32) {
o.DesiredVcpus = &v
}
// GetDesiredRam returns the DesiredRam field value if set, zero value otherwise.
func (o *VmResize) GetDesiredRam() int64 {
if o == nil || o.DesiredRam == nil {
var ret int64
return ret
}
return *o.DesiredRam
}
// GetDesiredRamOk returns a tuple with the DesiredRam field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmResize) GetDesiredRamOk() (*int64, bool) {
if o == nil || o.DesiredRam == nil {
return nil, false
}
return o.DesiredRam, true
}
// HasDesiredRam returns a boolean if a field has been set.
func (o *VmResize) HasDesiredRam() bool {
if o != nil && o.DesiredRam != nil {
return true
}
return false
}
// SetDesiredRam gets a reference to the given int64 and assigns it to the DesiredRam field.
func (o *VmResize) SetDesiredRam(v int64) {
o.DesiredRam = &v
}
// GetDesiredBalloon returns the DesiredBalloon field value if set, zero value otherwise.
func (o *VmResize) GetDesiredBalloon() int64 {
if o == nil || o.DesiredBalloon == nil {
var ret int64
return ret
}
return *o.DesiredBalloon
}
// GetDesiredBalloonOk returns a tuple with the DesiredBalloon field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmResize) GetDesiredBalloonOk() (*int64, bool) {
if o == nil || o.DesiredBalloon == nil {
return nil, false
}
return o.DesiredBalloon, true
}
// HasDesiredBalloon returns a boolean if a field has been set.
func (o *VmResize) HasDesiredBalloon() bool {
if o != nil && o.DesiredBalloon != nil {
return true
}
return false
}
// SetDesiredBalloon gets a reference to the given int64 and assigns it to the DesiredBalloon field.
func (o *VmResize) SetDesiredBalloon(v int64) {
o.DesiredBalloon = &v
}
func (o VmResize) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.DesiredVcpus != nil {
toSerialize["desired_vcpus"] = o.DesiredVcpus
}
if o.DesiredRam != nil {
toSerialize["desired_ram"] = o.DesiredRam
}
if o.DesiredBalloon != nil {
toSerialize["desired_balloon"] = o.DesiredBalloon
}
return json.Marshal(toSerialize)
}
type NullableVmResize struct {
value *VmResize
isSet bool
}
func (v NullableVmResize) Get() *VmResize {
return v.value
}
func (v *NullableVmResize) Set(val *VmResize) {
v.value = val
v.isSet = true
}
func (v NullableVmResize) IsSet() bool {
return v.isSet
}
func (v *NullableVmResize) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVmResize(val *VmResize) *NullableVmResize {
return &NullableVmResize{value: val, isSet: true}
}
func (v NullableVmResize) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVmResize) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,17 +1,150 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VmResizeZone struct for VmResizeZone
type VmResizeZone struct {
Id string `json:"id,omitempty"`
Id *string `json:"id,omitempty"`
// desired memory zone size in bytes
DesiredRam int64 `json:"desired_ram,omitempty"`
DesiredRam *int64 `json:"desired_ram,omitempty"`
}
// NewVmResizeZone instantiates a new VmResizeZone object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVmResizeZone() *VmResizeZone {
this := VmResizeZone{}
return &this
}
// NewVmResizeZoneWithDefaults instantiates a new VmResizeZone object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVmResizeZoneWithDefaults() *VmResizeZone {
this := VmResizeZone{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *VmResizeZone) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmResizeZone) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *VmResizeZone) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *VmResizeZone) SetId(v string) {
o.Id = &v
}
// GetDesiredRam returns the DesiredRam field value if set, zero value otherwise.
func (o *VmResizeZone) GetDesiredRam() int64 {
if o == nil || o.DesiredRam == nil {
var ret int64
return ret
}
return *o.DesiredRam
}
// GetDesiredRamOk returns a tuple with the DesiredRam field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmResizeZone) GetDesiredRamOk() (*int64, bool) {
if o == nil || o.DesiredRam == nil {
return nil, false
}
return o.DesiredRam, true
}
// HasDesiredRam returns a boolean if a field has been set.
func (o *VmResizeZone) HasDesiredRam() bool {
if o != nil && o.DesiredRam != nil {
return true
}
return false
}
// SetDesiredRam gets a reference to the given int64 and assigns it to the DesiredRam field.
func (o *VmResizeZone) SetDesiredRam(v int64) {
o.DesiredRam = &v
}
func (o VmResizeZone) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.DesiredRam != nil {
toSerialize["desired_ram"] = o.DesiredRam
}
return json.Marshal(toSerialize)
}
type NullableVmResizeZone struct {
value *VmResizeZone
isSet bool
}
func (v NullableVmResizeZone) Get() *VmResizeZone {
return v.value
}
func (v *NullableVmResizeZone) Set(val *VmResizeZone) {
v.value = val
v.isSet = true
}
func (v NullableVmResizeZone) IsSet() bool {
return v.isSet
}
func (v *NullableVmResizeZone) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVmResizeZone(val *VmResizeZone) *NullableVmResizeZone {
return &NullableVmResizeZone{value: val, isSet: true}
}
func (v NullableVmResizeZone) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVmResizeZone) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,15 +1,113 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VmSnapshotConfig struct for VmSnapshotConfig
type VmSnapshotConfig struct {
DestinationUrl string `json:"destination_url,omitempty"`
DestinationUrl *string `json:"destination_url,omitempty"`
}
// NewVmSnapshotConfig instantiates a new VmSnapshotConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVmSnapshotConfig() *VmSnapshotConfig {
this := VmSnapshotConfig{}
return &this
}
// NewVmSnapshotConfigWithDefaults instantiates a new VmSnapshotConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVmSnapshotConfigWithDefaults() *VmSnapshotConfig {
this := VmSnapshotConfig{}
return &this
}
// GetDestinationUrl returns the DestinationUrl field value if set, zero value otherwise.
func (o *VmSnapshotConfig) GetDestinationUrl() string {
if o == nil || o.DestinationUrl == nil {
var ret string
return ret
}
return *o.DestinationUrl
}
// GetDestinationUrlOk returns a tuple with the DestinationUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmSnapshotConfig) GetDestinationUrlOk() (*string, bool) {
if o == nil || o.DestinationUrl == nil {
return nil, false
}
return o.DestinationUrl, true
}
// HasDestinationUrl returns a boolean if a field has been set.
func (o *VmSnapshotConfig) HasDestinationUrl() bool {
if o != nil && o.DestinationUrl != nil {
return true
}
return false
}
// SetDestinationUrl gets a reference to the given string and assigns it to the DestinationUrl field.
func (o *VmSnapshotConfig) SetDestinationUrl(v string) {
o.DestinationUrl = &v
}
func (o VmSnapshotConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.DestinationUrl != nil {
toSerialize["destination_url"] = o.DestinationUrl
}
return json.Marshal(toSerialize)
}
type NullableVmSnapshotConfig struct {
value *VmSnapshotConfig
isSet bool
}
func (v NullableVmSnapshotConfig) Get() *VmSnapshotConfig {
return v.value
}
func (v *NullableVmSnapshotConfig) Set(val *VmSnapshotConfig) {
v.value = val
v.isSet = true
}
func (v NullableVmSnapshotConfig) IsSet() bool {
return v.isSet
}
func (v *NullableVmSnapshotConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVmSnapshotConfig(val *VmSnapshotConfig) *NullableVmSnapshotConfig {
return &NullableVmSnapshotConfig{value: val, isSet: true}
}
func (v NullableVmSnapshotConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVmSnapshotConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,15 +1,106 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VmmPingResponse Virtual Machine Monitor information
type VmmPingResponse struct {
Version string `json:"version"`
}
// NewVmmPingResponse instantiates a new VmmPingResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVmmPingResponse(version string) *VmmPingResponse {
this := VmmPingResponse{}
this.Version = version
return &this
}
// NewVmmPingResponseWithDefaults instantiates a new VmmPingResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVmmPingResponseWithDefaults() *VmmPingResponse {
this := VmmPingResponse{}
return &this
}
// GetVersion returns the Version field value
func (o *VmmPingResponse) GetVersion() string {
if o == nil {
var ret string
return ret
}
return o.Version
}
// GetVersionOk returns a tuple with the Version field value
// and a boolean to check if the value has been set.
func (o *VmmPingResponse) GetVersionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Version, true
}
// SetVersion sets field value
func (o *VmmPingResponse) SetVersion(v string) {
o.Version = v
}
func (o VmmPingResponse) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["version"] = o.Version
}
return json.Marshal(toSerialize)
}
type NullableVmmPingResponse struct {
value *VmmPingResponse
isSet bool
}
func (v NullableVmmPingResponse) Get() *VmmPingResponse {
return v.value
}
func (v *NullableVmmPingResponse) Set(val *VmmPingResponse) {
v.value = val
v.isSet = true
}
func (v NullableVmmPingResponse) IsSet() bool {
return v.isSet
}
func (v *NullableVmmPingResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVmmPingResponse(val *VmmPingResponse) *NullableVmmPingResponse {
return &NullableVmmPingResponse{value: val, isSet: true}
}
func (v NullableVmmPingResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVmmPingResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,20 +1,213 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// VsockConfig struct for VsockConfig
type VsockConfig struct {
// Guest Vsock CID
Cid int64 `json:"cid"`
// Path to UNIX domain socket, used to proxy vsock connections.
Socket string `json:"socket"`
Iommu bool `json:"iommu,omitempty"`
Id string `json:"id,omitempty"`
Socket string `json:"socket"`
Iommu *bool `json:"iommu,omitempty"`
Id *string `json:"id,omitempty"`
}
// NewVsockConfig instantiates a new VsockConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewVsockConfig(cid int64, socket string) *VsockConfig {
this := VsockConfig{}
this.Cid = cid
this.Socket = socket
var iommu bool = false
this.Iommu = &iommu
return &this
}
// NewVsockConfigWithDefaults instantiates a new VsockConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewVsockConfigWithDefaults() *VsockConfig {
this := VsockConfig{}
var iommu bool = false
this.Iommu = &iommu
return &this
}
// GetCid returns the Cid field value
func (o *VsockConfig) GetCid() int64 {
if o == nil {
var ret int64
return ret
}
return o.Cid
}
// GetCidOk returns a tuple with the Cid field value
// and a boolean to check if the value has been set.
func (o *VsockConfig) GetCidOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.Cid, true
}
// SetCid sets field value
func (o *VsockConfig) SetCid(v int64) {
o.Cid = v
}
// GetSocket returns the Socket field value
func (o *VsockConfig) GetSocket() string {
if o == nil {
var ret string
return ret
}
return o.Socket
}
// GetSocketOk returns a tuple with the Socket field value
// and a boolean to check if the value has been set.
func (o *VsockConfig) GetSocketOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Socket, true
}
// SetSocket sets field value
func (o *VsockConfig) SetSocket(v string) {
o.Socket = v
}
// GetIommu returns the Iommu field value if set, zero value otherwise.
func (o *VsockConfig) GetIommu() bool {
if o == nil || o.Iommu == nil {
var ret bool
return ret
}
return *o.Iommu
}
// GetIommuOk returns a tuple with the Iommu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VsockConfig) GetIommuOk() (*bool, bool) {
if o == nil || o.Iommu == nil {
return nil, false
}
return o.Iommu, true
}
// HasIommu returns a boolean if a field has been set.
func (o *VsockConfig) HasIommu() bool {
if o != nil && o.Iommu != nil {
return true
}
return false
}
// SetIommu gets a reference to the given bool and assigns it to the Iommu field.
func (o *VsockConfig) SetIommu(v bool) {
o.Iommu = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *VsockConfig) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VsockConfig) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *VsockConfig) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *VsockConfig) SetId(v string) {
o.Id = &v
}
func (o VsockConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["cid"] = o.Cid
}
if true {
toSerialize["socket"] = o.Socket
}
if o.Iommu != nil {
toSerialize["iommu"] = o.Iommu
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
return json.Marshal(toSerialize)
}
type NullableVsockConfig struct {
value *VsockConfig
isSet bool
}
func (v NullableVsockConfig) Get() *VsockConfig {
return v.value
}
func (v *NullableVsockConfig) Set(val *VsockConfig) {
v.value = val
v.isSet = true
}
func (v NullableVsockConfig) IsSet() bool {
return v.isSet
}
func (v *NullableVsockConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVsockConfig(val *VsockConfig) *NullableVsockConfig {
return &NullableVsockConfig{value: val, isSet: true}
}
func (v NullableVsockConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVsockConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -1,11 +1,12 @@
/*
* Cloud Hypervisor API
*
* Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
*
* API version: 0.3.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
@@ -31,7 +32,7 @@ type APIResponse struct {
Payload []byte `json:"-"`
}
// NewAPIResponse returns a new APIResonse object.
// NewAPIResponse returns a new APIResponse object.
func NewAPIResponse(r *http.Response) *APIResponse {
response := &APIResponse{Response: r}

View File

@@ -0,0 +1,328 @@
/*
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"time"
)
// PtrBool is a helper routine that returns a pointer to given boolean value.
func PtrBool(v bool) *bool { return &v }
// PtrInt is a helper routine that returns a pointer to given integer value.
func PtrInt(v int) *int { return &v }
// PtrInt32 is a helper routine that returns a pointer to given integer value.
func PtrInt32(v int32) *int32 { return &v }
// PtrInt64 is a helper routine that returns a pointer to given integer value.
func PtrInt64(v int64) *int64 { return &v }
// PtrFloat32 is a helper routine that returns a pointer to given float value.
func PtrFloat32(v float32) *float32 { return &v }
// PtrFloat64 is a helper routine that returns a pointer to given float value.
func PtrFloat64(v float64) *float64 { return &v }
// PtrString is a helper routine that returns a pointer to given string value.
func PtrString(v string) *string { return &v }
// PtrTime is helper routine that returns a pointer to given Time value.
func PtrTime(v time.Time) *time.Time { return &v }
type NullableBool struct {
value *bool
isSet bool
}
func (v NullableBool) Get() *bool {
return v.value
}
func (v *NullableBool) Set(val *bool) {
v.value = val
v.isSet = true
}
func (v NullableBool) IsSet() bool {
return v.isSet
}
func (v *NullableBool) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBool(val *bool) *NullableBool {
return &NullableBool{value: val, isSet: true}
}
func (v NullableBool) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBool) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt struct {
value *int
isSet bool
}
func (v NullableInt) Get() *int {
return v.value
}
func (v *NullableInt) Set(val *int) {
v.value = val
v.isSet = true
}
func (v NullableInt) IsSet() bool {
return v.isSet
}
func (v *NullableInt) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt(val *int) *NullableInt {
return &NullableInt{value: val, isSet: true}
}
func (v NullableInt) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt32 struct {
value *int32
isSet bool
}
func (v NullableInt32) Get() *int32 {
return v.value
}
func (v *NullableInt32) Set(val *int32) {
v.value = val
v.isSet = true
}
func (v NullableInt32) IsSet() bool {
return v.isSet
}
func (v *NullableInt32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt32(val *int32) *NullableInt32 {
return &NullableInt32{value: val, isSet: true}
}
func (v NullableInt32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt64 struct {
value *int64
isSet bool
}
func (v NullableInt64) Get() *int64 {
return v.value
}
func (v *NullableInt64) Set(val *int64) {
v.value = val
v.isSet = true
}
func (v NullableInt64) IsSet() bool {
return v.isSet
}
func (v *NullableInt64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt64(val *int64) *NullableInt64 {
return &NullableInt64{value: val, isSet: true}
}
func (v NullableInt64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat32 struct {
value *float32
isSet bool
}
func (v NullableFloat32) Get() *float32 {
return v.value
}
func (v *NullableFloat32) Set(val *float32) {
v.value = val
v.isSet = true
}
func (v NullableFloat32) IsSet() bool {
return v.isSet
}
func (v *NullableFloat32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat32(val *float32) *NullableFloat32 {
return &NullableFloat32{value: val, isSet: true}
}
func (v NullableFloat32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat64 struct {
value *float64
isSet bool
}
func (v NullableFloat64) Get() *float64 {
return v.value
}
func (v *NullableFloat64) Set(val *float64) {
v.value = val
v.isSet = true
}
func (v NullableFloat64) IsSet() bool {
return v.isSet
}
func (v *NullableFloat64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat64(val *float64) *NullableFloat64 {
return &NullableFloat64{value: val, isSet: true}
}
func (v NullableFloat64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableString struct {
value *string
isSet bool
}
func (v NullableString) Get() *string {
return v.value
}
func (v *NullableString) Set(val *string) {
v.value = val
v.isSet = true
}
func (v NullableString) IsSet() bool {
return v.isSet
}
func (v *NullableString) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableString(val *string) *NullableString {
return &NullableString{value: val, isSet: true}
}
func (v NullableString) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableString) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableTime struct {
value *time.Time
isSet bool
}
func (v NullableTime) Get() *time.Time {
return v.value
}
func (v *NullableTime) Set(val *time.Time) {
v.value = val
v.isSet = true
}
func (v NullableTime) IsSet() bool {
return v.isSet
}
func (v *NullableTime) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTime(val *time.Time) *NullableTime {
return &NullableTime{value: val, isSet: true}
}
func (v NullableTime) MarshalJSON() ([]byte, error) {
return v.value.MarshalJSON()
}
func (v *NullableTime) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -567,7 +567,7 @@ components:
default: false
hotplug_method:
type: string
default: "acpi"
default: "Acpi"
shared:
type: boolean
default: false
@@ -714,7 +714,7 @@ components:
type: string
vhost_mode:
type: string
default: "client"
default: "Client"
id:
type: string
fd:

View File

@@ -43,7 +43,6 @@ const (
)
var qemuPaths = map[string]string{
QemuPCLite: "/usr/bin/qemu-lite-system-x86_64",
QemuQ35: defaultQemuPath,
QemuMicrovm: defaultQemuPath,
}
@@ -66,10 +65,6 @@ var kernelParams = []Param{
}
var supportedQemuMachines = []govmmQemu.Machine{
{
Type: QemuPCLite,
Options: defaultQemuMachineOptions,
},
{
Type: QemuQ35,
Options: defaultQemuMachineOptions,

View File

@@ -209,9 +209,6 @@ const (
const bridgePCIStartAddr = 2
const (
// QemuPCLite is the QEMU pc-lite machine type for amd64
QemuPCLite = "pc-lite"
// QemuQ35 is the QEMU Q35 machine type for amd64
QemuQ35 = "q35"

View File

@@ -158,7 +158,7 @@ func TestQemuAddDeviceToBridge(t *testing.T) {
// addDeviceToBridge fails cause q.Bridges == 0
q = newQemuArchBase()
q.qemuMachine.Type = QemuPCLite
q.qemuMachine.Type = QemuQ35
q.bridges(0)
_, _, err = q.addDeviceToBridge(context.Background(), "qemu-bridge", types.PCI)
if assert.Error(err) {

View File

@@ -68,6 +68,7 @@ const (
DirMode = os.FileMode(0750) | os.ModeDir
mkswapPath = "/sbin/mkswap"
rwm = "rwm"
)
var (
@@ -589,6 +590,33 @@ func (s *Sandbox) createCgroupManager() error {
if spec.Linux.Resources != nil {
resources.Devices = spec.Linux.Resources.Devices
intptr := func(i int64) *int64 { return &i }
// Determine if device /dev/null and /dev/urandom exist, and add if they don't
nullDeviceExist := false
urandomDeviceExist := false
for _, device := range resources.Devices {
if device.Type == "c" && device.Major == intptr(1) && device.Minor == intptr(3) {
nullDeviceExist = true
}
if device.Type == "c" && device.Major == intptr(1) && device.Minor == intptr(9) {
urandomDeviceExist = true
}
}
if !nullDeviceExist {
// "/dev/null"
resources.Devices = append(resources.Devices, []specs.LinuxDeviceCgroup{
{Type: "c", Major: intptr(1), Minor: intptr(3), Access: rwm, Allow: true},
}...)
}
if !urandomDeviceExist {
// "/dev/urandom"
resources.Devices = append(resources.Devices, []specs.LinuxDeviceCgroup{
{Type: "c", Major: intptr(1), Minor: intptr(9), Access: rwm, Allow: true},
}...)
}
if spec.Linux.Resources.CPU != nil {
resources.CPU = &specs.LinuxCPU{
Cpus: spec.Linux.Resources.CPU.Cpus,
@@ -700,7 +728,7 @@ func (s *Sandbox) Delete(ctx context.Context) error {
for _, c := range s.containers {
if err := c.delete(ctx); err != nil {
s.Logger().WithError(err).WithField("cid", c.id).Debug("failed to delete container")
s.Logger().WithError(err).WithField("container`", c.id).Debug("failed to delete container")
}
}
@@ -1264,7 +1292,7 @@ func (s *Sandbox) CreateContainer(ctx context.Context, contConfig ContainerConfi
defer func() {
// Rollback if error happens.
if err != nil {
logger := s.Logger().WithFields(logrus.Fields{"container-id": c.id, "sandox-id": s.id, "rollback": true})
logger := s.Logger().WithFields(logrus.Fields{"container": c.id, "sandbox": s.id, "rollback": true})
logger.WithError(err).Error("Cleaning up partially created container")
if errStop := c.stop(ctx, true); errStop != nil {
@@ -1311,7 +1339,7 @@ func (s *Sandbox) StartContainer(ctx context.Context, containerID string) (VCCon
return nil, err
}
s.Logger().Info("Container is started")
s.Logger().WithField("container", containerID).Info("Container is started")
// Update sandbox resources in case a stopped container
// is started
@@ -1998,7 +2026,7 @@ func (s *Sandbox) calculateSandboxMemory() (int64, bool, int64) {
for _, c := range s.config.Containers {
// Do not hot add again non-running containers resources
if cont, ok := s.containers[c.ID]; ok && cont.state.State == types.StateStopped {
s.Logger().WithField("container-id", c.ID).Debug("Do not taking into account memory resources of not running containers")
s.Logger().WithField("container", c.ID).Debug("Do not taking into account memory resources of not running containers")
continue
}
@@ -2035,7 +2063,7 @@ func (s *Sandbox) calculateSandboxCPUs() (uint32, error) {
for _, c := range s.config.Containers {
// Do not hot add again non-running containers resources
if cont, ok := s.containers[c.ID]; ok && cont.state.State == types.StateStopped {
s.Logger().WithField("container-id", c.ID).Debug("Do not taking into account CPU resources of not running containers")
s.Logger().WithField("container", c.ID).Debug("Do not taking into account CPU resources of not running containers")
continue
}

View File

@@ -36,7 +36,7 @@ build_initrd() {
mv "kata-containers-initrd.img" "${install_dir}/${initrd_name}"
(
cd "${install_dir}"
ln -sf "${builddir}" kata-containers-initrd.img
ln -sf "${initrd_name}" kata-containers-initrd.img
)
}

View File

@@ -11,19 +11,40 @@ a node only if it uses either containerd or CRI-O CRI-shims.
### Install Kata on a running Kubernetes cluster
#### Installing the latest image
The latest image refers to pre-release and release candidate content. For stable releases, please, use the "stable" instructions.
```sh
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy
$ kubectl apply -f kata-rbac/base/kata-rbac.yaml
$ kubectl apply -f kata-deploy/base/kata-deploy.yaml
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml
```
or on a [k3s](https://k3s.io/) cluster:
#### Installing the stable image
The stable image refers to the last stable releases content.
Note that if you use a tagged version of the repo, the stable image does match that version.
For instance, if you use the 2.2.1 tagged version of the kata-deploy.yaml file, then the version 2.2.1 of the kata runtime will be deployed.
```sh
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy-stable.yaml
```
#### For your [k3s](https://k3s.io/) cluster, do:
```sh
$ GO111MODULE=auto go get github.com/kata-containers/kata-containers
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy
$ kubectl apply -k kata-deploy/overlays/k3s
```
#### Ensure kata-deploy is ready
```sh
kubectl -n kube-system wait --timeout=10m --for=condition=Ready -l name=kata-deploy pod
```
### Run a sample workload
Workloads specify the runtime they'd like to utilize by setting the appropriate `runtimeClass` object within
@@ -32,8 +53,7 @@ which will ensure the workload is only scheduled on a node that has Kata Contain
`runtimeClass` is a built-in type in Kubernetes. To apply each Kata Containers `runtimeClass`:
```sh
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/runtimeclasses
$ kubectl apply -f kata-runtimeClasses.yaml
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml
```
The following YAML snippet shows how to specify a workload should use Kata with Cloud Hypervisor:
@@ -66,42 +86,74 @@ spec:
To run an example with `kata-clh`:
```sh
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/examples
$ kubectl apply -f test-deploy-kata-clh.yaml
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/examples/test-deploy-kata-clh.yaml
```
To run an example with `kata-fc`:
```sh
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/examples
$ kubectl apply -f test-deploy-kata-fc.yaml
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/examples/test-deploy-kata-fc.yaml
```
To run an example with `kata-qemu`:
```sh
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/examples
$ kubectl apply -f test-deploy-kata-qemu.yaml
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/examples/test-deploy-kata-qemu.yaml
```
The following removes the test pods:
```sh
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/examples
$ kubectl delete -f test-deploy-kata-clh.yaml
$ kubectl delete -f test-deploy-kata-fc.yaml
$ kubectl delete -f test-deploy-kata-qemu.yaml
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/examples/test-deploy-kata-clh.yaml
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/examples/test-deploy-kata-fc.yaml
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/examples/test-deploy-kata-qemu.yaml
```
### Remove Kata from the Kubernetes cluster
#### Removing the latest image
```sh
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy
$ kubectl delete -f kata-deploy/base/kata-deploy.yaml
$ kubectl apply -f kata-cleanup/base/kata-cleanup.yaml
$ kubectl delete -f kata-cleanup/base/kata-cleanup.yaml
$ kubectl delete -f kata-rbac/base/kata-rbac.yaml
$ kubectl delete -f runtimeclasses/kata-runtimeClasses.yaml
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml
$ kubectl -n kube-system wait --timeout=10m --for=delete -l name=kata-deploy pod
```
After ensuring kata-deploy has been deleted, cleanup the cluster:
```sh
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml
```
The cleanup daemon-set will run a single time, cleaning up the node-label, which makes it difficult to check in an automated fashion.
This process should take, at most, 5 minutes.
After that, let's delete the cleanup daemon-set, the added RBAC and runtime classes:
```sh
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml
```
#### Removing the stable image
```sh
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy-stable.yaml
$ kubectl -n kube-system wait --timeout=10m --for=delete -l name=kata-deploy pod
```
After ensuring kata-deploy has been deleted, cleanup the cluster:
```sh
$ kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup-stabe.yaml
```
The cleanup daemon-set will run a single time, cleaning up the node-label, which makes it difficult to check in an automated fashion.
This process should take, at most, 5 minutes.
After that, let's delete the cleanup daemon-set, the added RBAC and runtime classes:
```sh
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup-stable.yaml
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml
$ kubectl delete -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml
```
## `kata-deploy` details

Some files were not shown because too many files have changed in this diff Show More