services.VnicProfilesService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of model Show documentation
Show all versions of model Show documentation
Model management tools for the oVirt Engine API.
/*
Copyright (c) 2015 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package services;
import annotations.Area;
import mixins.Follow;
import org.ovirt.api.metamodel.annotations.In;
import org.ovirt.api.metamodel.annotations.InputDetail;
import org.ovirt.api.metamodel.annotations.Out;
import org.ovirt.api.metamodel.annotations.Service;
import types.VnicProfile;
import static org.ovirt.api.metamodel.language.ApiLanguage.COLLECTION;
import static org.ovirt.api.metamodel.language.ApiLanguage.mandatory;
import static org.ovirt.api.metamodel.language.ApiLanguage.optional;
/**
* This service manages the collection of all vNIC profiles.
*
* @author Dominik Holler
* @date 12 Dec 2016
* @status added
*/
@Service
@Area("Network")
public interface VnicProfilesService {
/**
* Add a vNIC profile.
*
* For example to add vNIC profile `123` to network `456` send a request to:
*
* [source]
* ----
* POST /ovirt-engine/api/networks/456/vnicprofiles
* ----
*
* With the following body:
*
* [source,xml]
* ----
*
* new_vNIC_name
*
* disabled
*
* false
*
* ----
*
* Please note that there is a default network filter to each VNIC profile.
* For more details of how the default network filter is calculated please refer to
* the documentation in <>.
*
* NOTE: The automatically created vNIC profile for the external network will be without network filter.
*
* The output of creating a new VNIC profile depends in the body arguments that were given.
* In case no network filter was given, the default network filter will be configured. For example:
*
* [source,xml]
* ----
*
* new_vNIC_name
*
*
* disabled
*
* false
*
*
*
* ----
*
* In case an empty network filter was given, no network filter will be configured for the specific VNIC profile
* regardless of the VNIC profile's default network filter. For example:
*
* [source,xml]
* ----
*
* no_network_filter
*
*
* ----
*
* In case that a specific valid network filter id was given, the VNIC profile will be configured with the given
* network filter regardless of the VNIC profiles's default network filter. For example:
*
* [source,xml]
* ----
*
* user_choice_network_filter
*
*
* ----
*
* @author Alona Kaplan
* @author Dominik Holler
* @author Ales Musil
* @author Billy Burmester
* @date 30 March 2021
* @status updated
*/
interface Add {
@InputDetail
default void inputDetail() {
mandatory(profile().name());
mandatory(profile().network().id());
optional(profile().description());
optional(profile().passThrough().mode());
optional(profile().portMirroring());
optional(profile().customProperties()[COLLECTION].name());
optional(profile().customProperties()[COLLECTION].value());
optional(profile().failover());
}
/**
* The vNIC profile that is being added.
*
* @author Dominik Holler
* @date 12 Dec 2016
* @status added
*/
@In @Out VnicProfile profile();
}
/**
* List all vNIC profiles.
*
* The order of the returned list of vNIC profiles isn't guaranteed.
*
* @author Dominik Holler
* @author Billy Burmester
* @date 15 May 2018
* @status updated_by_docs
*/
interface List extends Follow {
/**
* The list of all vNIC profiles.
*
* @author Dominik Holler
* @author Billy Burmester
* @date 15 May 2018
* @status updated_by_docs
*/
@Out VnicProfile[] profiles();
/**
* Sets the maximum number of profiles to return. If not specified all the profiles are returned.
*
* @author Juan Hernandez
* @author Billy Burmester
* @date 15 May 2018
* @status updated_by_docs
*/
@In Integer max();
}
@Service VnicProfileService profile(String id);
}