コード例 #1
0
  /**
   * Adds VnicProfile object.
   *
   * @param vnicprofile {@link org.ovirt.engine.sdk.entities.VnicProfile}
   *     <pre>
   *    vnicprofile.network.id
   *    vnicprofile.name
   *    [vnicprofile.description]
   *    [vnicprofile.port_mirroring]
   *    [vnicprofile.custom_properties.custom_property]
   *    </pre>
   *
   * @param expect
   *     <pre>
   *    [201-created]
   *    </pre>
   *
   * @param correlationId
   *     <pre>
   *    [any string]
   *    </pre>
   *
   * @return {@link VnicProfile }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public VnicProfile add(
      org.ovirt.engine.sdk.entities.VnicProfile vnicprofile, String expect, String correlationId)
      throws ClientProtocolException, ServerException, IOException {
    String url = SLASH + getName();

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    if (expect != null) {
      headersBuilder.add("Expect", expect);
    }
    if (correlationId != null) {
      headersBuilder.add("Correlation-Id", correlationId);
    }
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(url);
    url = urlBuilder.build();

    return getProxy()
        .add(
            url,
            vnicprofile,
            org.ovirt.engine.sdk.entities.VnicProfile.class,
            VnicProfile.class,
            headers);
  }
コード例 #2
0
  /**
   * Deletes object.
   *
   * @return {@link Response }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public Response delete() throws ClientProtocolException, ServerException, IOException {
    String url = this.getHref();

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(url);
    url = urlBuilder.build();

    return getProxy().delete(url, Response.class, headers);
  }
コード例 #3
0
  /**
   * Adds NIC object.
   *
   * @param nic {@link org.ovirt.engine.sdk.entities.NIC}
   *     <pre>
   *    Overload 1:
   *
   *      add a new network interface to
   *      the given virtual machine with
   *      vnic profile id
   *
   *      nic.name
   *      [nic.vnic_profile.id]
   *      [nic.linked]
   *      [nic.mac.address]
   *      [nic.interface]
   *      [nic.plugged]
   *
   *    Overload 2:
   *
   *      add a new network interface to
   *      the given virtual machine with
   *      port mirroring options
   *
   *      nic.name
   *      [nic.network.id|name]
   *      [nic.linked]
   *      [nic.mac.address]
   *      [nic.interface]
   *      [nic.port_mirroring.networks.network]
   *      [nic.plugged]
   *    </pre>
   *
   * @return {@link VMNIC }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public VMNIC add(org.ovirt.engine.sdk.entities.NIC nic)
      throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName();

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(url);
    url = urlBuilder.build();

    return getProxy().add(url, nic, org.ovirt.engine.sdk.entities.NIC.class, VMNIC.class, headers);
  }
コード例 #4
0
  /**
   * Lists VnicProfile objects.
   *
   * @param max
   *     <pre>
   *    [max results]
   *    </pre>
   *
   * @return List of {@link VnicProfile }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public List<VnicProfile> list(Integer max)
      throws ClientProtocolException, ServerException, IOException {

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(SLASH + getName());
    if (max != null) {
      urlBuilder.add("max", max, UrlParameterType.MATRIX);
    }

    String url = urlBuilder.build();

    return list(url, org.ovirt.engine.sdk.entities.VnicProfiles.class, VnicProfile.class, headers);
  }
コード例 #5
0
  /**
   * Deletes object.
   *
   * @param async
   *     <pre>
   *    [true|false]
   *    </pre>
   *
   * @return {@link Response }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public Response delete(Boolean async)
      throws ClientProtocolException, ServerException, IOException {
    String url = this.getHref();

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(url);
    if (async != null) {
      urlBuilder.add("async", async, UrlParameterType.MATRIX);
    }

    url = urlBuilder.build();

    return getProxy().delete(url, Response.class, headers);
  }
コード例 #6
0
  /**
   * Lists StorageDomainTemplateDisk objects.
   *
   * @param max
   *     <pre>
   *    [max results]
   *    </pre>
   *
   * @return List of {@link StorageDomainTemplateDisk }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public List<StorageDomainTemplateDisk> list(Integer max)
      throws ClientProtocolException, ServerException, IOException {

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(this.parent.getHref() + SLASH + getName());
    if (max != null) {
      urlBuilder.add("max", max, UrlParameterType.MATRIX);
    }

    String url = urlBuilder.build();

    return list(
        url, org.ovirt.engine.sdk.entities.Disks.class, StorageDomainTemplateDisk.class, headers);
  }
コード例 #7
0
  /**
   * Adds VnicProfile object.
   *
   * @param vnicprofile {@link org.ovirt.engine.sdk.entities.VnicProfile}
   *     <pre>
   *    vnicprofile.network.id
   *    vnicprofile.name
   *    [vnicprofile.description]
   *    [vnicprofile.port_mirroring]
   *    [vnicprofile.custom_properties.custom_property]
   *    </pre>
   *
   * @return {@link VnicProfile }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public VnicProfile add(org.ovirt.engine.sdk.entities.VnicProfile vnicprofile)
      throws ClientProtocolException, ServerException, IOException {
    String url = SLASH + getName();

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(url);
    url = urlBuilder.build();

    return getProxy()
        .add(
            url,
            vnicprofile,
            org.ovirt.engine.sdk.entities.VnicProfile.class,
            VnicProfile.class,
            headers);
  }
コード例 #8
0
  /**
   * Lists VMNIC objects.
   *
   * @param max
   *     <pre>
   *    [max results]
   *    </pre>
   *
   * @param allContent
   *     <pre>
   *    [true|false]
   *    </pre>
   *
   * @return List of {@link VMNIC }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public List<VMNIC> list(Integer max, String allContent)
      throws ClientProtocolException, ServerException, IOException {

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    if (allContent != null) {
      headersBuilder.add("All-Content", allContent);
    }
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(this.parent.getHref() + SLASH + getName());
    if (max != null) {
      urlBuilder.add("max", max, UrlParameterType.MATRIX);
    }

    String url = urlBuilder.build();

    return list(url, org.ovirt.engine.sdk.entities.Nics.class, VMNIC.class, headers);
  }
コード例 #9
0
  /**
   * Adds NIC object.
   *
   * @param nic {@link org.ovirt.engine.sdk.entities.NIC}
   *     <pre>
   *    Overload 1:
   *
   *      add a new network interface to
   *      the given virtual machine with
   *      vnic profile id
   *
   *      nic.name
   *      [nic.vnic_profile.id]
   *      [nic.linked]
   *      [nic.mac.address]
   *      [nic.interface]
   *      [nic.plugged]
   *
   *    Overload 2:
   *
   *      add a new network interface to
   *      the given virtual machine with
   *      port mirroring options
   *
   *      nic.name
   *      [nic.network.id|name]
   *      [nic.linked]
   *      [nic.mac.address]
   *      [nic.interface]
   *      [nic.port_mirroring.networks.network]
   *      [nic.plugged]
   *    </pre>
   *
   * @param expect
   *     <pre>
   *    [201-created]
   *    </pre>
   *
   * @param correlationId
   *     <pre>
   *    [any string]
   *    </pre>
   *
   * @return {@link VMNIC }
   * @throws ClientProtocolException Signals that HTTP/S protocol error has occurred.
   * @throws ServerException Signals that an oVirt api error has occurred.
   * @throws IOException Signals that an I/O exception of some sort has occurred.
   */
  public VMNIC add(org.ovirt.engine.sdk.entities.NIC nic, String expect, String correlationId)
      throws ClientProtocolException, ServerException, IOException {
    String url = this.parent.getHref() + SLASH + getName();

    HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
    if (expect != null) {
      headersBuilder.add("Expect", expect);
    }
    if (correlationId != null) {
      headersBuilder.add("Correlation-Id", correlationId);
    }
    List<Header> headers = headersBuilder.build();

    UrlBuilder urlBuilder = new UrlBuilder(url);
    url = urlBuilder.build();

    return getProxy().add(url, nic, org.ovirt.engine.sdk.entities.NIC.class, VMNIC.class, headers);
  }