/**
   * 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);
  }
  /**
   * 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);
  }
Ejemplo n.º 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);
  }
  /**
   * 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);
  }
  /**
   * 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);
  }
  /**
   * 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);
  }
  /**
   * 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);
  }
Ejemplo n.º 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);
  }
Ejemplo n.º 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);
  }