Table Of Contents
PortProfileApp Service
Information About PortProfileApp Service
bindInterfacesWithPortProfile
bindPortProfileWithBasePortProfile
createPortProfile
createPortProfileForNetworkElements
disablePortProfiles
deletePortProfiles
enablePortProfiles
getPortProfiles
getPortProfilesWithInheritedPorts
getPortProfilesWithInterfaceCount
getPortProfilesByTypeInNetworkElements
getPortProfilesInNetworkElements
modifyPortProfiles
modifyProfileModeToRouted
modifyProfileModeToSwitched
modifySwitchPortMode
unbindInterfacesWithPortProfile
unbindPortProfileWithBasePortProfile
PortProfileApp Service
This chapter describes the DCNM web services' API methods for the PortProfileApp service. This API is available for Cisco Nexus 7000 Series switches that run Cisco NX-OS Release 5.0(3) or later.
Information About PortProfileApp Service
This interface defines all the APIs exposed by the PortProfileApp Service.
Port profileApp service allows you to bring together and apply repetitive interface configuration to an interface range. After you configure a port-profile, you can inherit the configuration settings to an interface or a range of interfaces.
The API categories are as follows:
•
Query/Get APIs—Query data from the persisted database.
•
Create APIs—Create new Port-Profiles.
•
Modify APIs—Basic attributes of existing Port-profiles.
•
Delete APIs—Delete existing Port-profiles.
bindInterfacesWithPortProfile
Associate a List of instance to one PortProfile instances existing in the same device.
ValidationException is thrown if any of the following situation occurs:
•
If niInstanceNameIds is null or it is empty.
•
If niInstanceNameIds contains invalid NetworkInterface InstanceNameId or null value.
•
If there is no equivalent NetworkInterface object with the given InstanceNameId in the niInstanceNameIds.
•
If all NetworkInterface object with the given InstanceNameId in the niInstanceNameIds are not part of same AbstractNetworkElement.
•
If InstanceNameId for PortProfile instance is null or invalid.
•
If InstanceNameId corresponding to any PortProfile instance in profileInstanceNameId doesnt belongs to same devices.
•
If the profile and interface type is not same for Nexus-7000.
•
If the profile inherits the interface, and the interface PortCapability doesnt allow to configure specific setting PortSetting which is actually set on profile. For example, if a profile sets the speed as 10000 and profile is in enabled state. So when this profile is inherited by 1 gig interface, device will throw an exception.
Parameters
opContext—Current Operational context
niInstanceNameIds—List of InstanceNameId of network interfaces which need to be associated to profile.
profileInstanceNameId—InstanceNameId of PortProfile instances. .
Return Value
void.
bindPortProfileWithBasePortProfile
Associates a PortProfile instance as parent to a list of PortProfile instances, in the same device.
ValidationException is thrown if any of the following situation occurs:
•
If baseProfileInstanceNameId is null or it is invalid.
•
If there is no equivalent PortProfile object with the given InstanceNameId in the baseProfileInstanceNameId.
•
If subProfileInstanceNameIds is null or it is empty.
•
If there is no equivalent PortProfile object with the given InstanceNameId in the subProfileInstanceNameIds.
•
If InstanceNameId corresponding to each PortProfile instance in subProfileInstanceNameIds doesnt belongs to same device as for baseProfileInstanceNameId.
•
If the profile types are not same for Nexus-7000.
Parameters
opContext—Current Operational context.
baseProfileInstanceNameId—InstanceNameId of PortProfile instances.
subProfileInstanceNameIds—List of InstanceNameId of PortProfile instances.
Return Value
void.
createPortProfile
Creates the PortProfile objects in respective network elements.
ValidationException is thrown if any of the following situation occurs:
•
if the argument passed is null for profileInstanceNameIds or it is not a valid port profile InstanceNameId.
•
If the name of the profile exceeds 80 characters.
Parameters
opContext—Current Operational context
neInstanceNameIdCol—List of Instance name IDs of the network element.
profiles—List of PortProfile objects that need to be created.
Return Value
Instance name IDs of the newly created port profile objects.
createPortProfileForNetworkElements
Creates the PortProfile objects in one or more than one network elements.
ValidationException is thrown if any of the following situation occurs:
•
If the argument passed is null for neInstanceNameIdCol or it is not a valid network element InstanceNameId.
•
If the argument passed is null for profiles.
•
If the name of the profile exceeds 80 characters.
IntegrityException is thrown if the PortProfile already exists in the database.
Parameters
opContext—Current Operational context.
neInstanceNameIdCol—List of Instance name IDs of the network element.
profiles—List of PortProfile objects that need to be created.
Return Value
Instance name IDs of the newly created port profile objects.
disablePortProfiles
Disables PortProfile state for the given profile InstanceNameIds.
ValidationException is thrown if any of the following situation occurs:
•
If the argument passed is null.
•
If the profileInstanceNameIds collection is empty or the collection contains object which are not a valid port-profile InstanceNameId.
Parameters
opContext—Current Operational context.
profileInstanceNameIds—List of InstanceNameId corresponding to the port-profiles.
Return Value
void.
deletePortProfiles
Delete one or more existing port profile objects. This method is available for Cisco Nexus 7000 Series switches that run Cisco NX-OS Release 5.1(1) or later.
ValidationException is thrown if any of the following situation occurs:
•
If the argument passed is null.
•
If portProfileIds collection contains an element that is not of type PortProfile InstanceNameId.
•
If portProfileIds collection contains a PortProfile that does not exist in the database.
•
If the profile to be deleted is inherited by some other profile instance or is inherited by some other interface.
Parameters
opContext—Current Operational context.
portProfileIds - list of instance name Ids of the PortProfile objects.
deleteChildProfiles - Set TRUE to delete all the child profiles with it's children.
Return Value
void.
enablePortProfiles
Enables PortProfile state for the given profile InstanceNameIds.
ValidationException is thrown if any of the following situation occurs:
•
If the argument passed is null.
•
If the profileInstanceNameIds collection is empty or the collection contains object which are not a valid port-profile InstanceNameId.
•
If the profile inherits the interface, where the interface PortCapability doesnt allow to configure specific setting PortSetting which is actually set on profile. For example, if a profile sets the speed as 10000 and this profile is inherited by 1 gig interface, then when the profile state is enabled, device will throw an exception.
Parameters
opContext—Current Operational context.
profileInstanceNameIds—List of InstanceNameId corresponding to the port-profiles.
Return Value
void.
getPortProfiles
Returns a collection of port-profiles objects.
ValidationException is thrown if the argument passed is null for profileInstanceNameIds or it is not a valid port profile InstanceNameId. .
Parameters
opContext—Current Operational context
profileInstanceNameIds—List of InstanceNameId corresponding to the port profiles
Return Value
List of PortProfile instances present in the device. In the returned list of objects only the following associations will be available.
•
NetworkInterfaceName
•
PortSetting
•
PortCapability
•
BasePortProfileRef
•
Collection of inherited Network Interface link.
getPortProfilesWithInheritedPorts
Returns a collection of port-profiles objects with inherited interface instances. Given the instance name ID of a port-profile, returns a collection of port-profile objects respectively. If no interface is associated with the profile, then it will return only portprofile instance without any associations. This method is available for Cisco Nexus 7000 Series switches that run Cisco NX-OS Release 5.1(1) or later.
ValidationException is thrown if the argument passed is null for profileInstanceNameIds or it is not a valid port profile InstanceNameId. .
Parameters
opContext—Current Operational context
profileInstanceNameIds—List of InstanceNameId corresponding to the port profiles
Return Value
List of PortProfile instances present in the device. In the returned list of objects only the following associations will be available and all other associations will be cleared.
•
NetworkInterfaceName
•
Collection of inherited Network Interface link.
getPortProfilesWithInterfaceCount
Returns a collection of port-profiles objects present in a network element and inherited interfaces count. Given the list of instance name ID of network element, returns a list containing collection of port-profile objects respectively. The port-profile instance will be populated with PortSetting ref. It can be null if nothing is set on the port-profile as there are no defaults in case of Setting for profiles. Also the profile will be populated with port-profile capability. If no interface is associated with the profile, then it will return all the possible capabilities for that type of profile. If the neInstanceNameIdCol is null, then PortProfile will be returned for all the discovered devices. This method is available for Cisco Nexus 7000 Series switches that run Cisco NX-OS Release 5.1(1) or later.
ValidationException is thrown if the argument passed is null for profileInstanceNameIds or it is not a valid port profile InstanceNameId. .
Parameters
opContext—Current Operational context
neInstanceNameIdCol - List of InstanceNameId corresponding to the network elements
Return Value
List of pairs that contains PortProfile presents in the device and inherited Interfaces count. In the returned list of PortProfile objects only the following associations will be available and all other associations will be cleared.
•
NetworkInterfaceName
•
PortSetting
•
PortCapability
getPortProfilesByTypeInNetworkElements
Returns a collection of port-profiles objects of type PortProfileType present in a network element.
ValidationException is thrown if the argument passed is null for neInstanceNameIdCol or it is not a valid network element InstanceNameId.
Parameters
opContext—Current Operational context
profileType—Refers to the type of profile, which needs to be fetched
neInstanceNameIdCol—List of InstanceNameId corresponding to the network elements.
Return Value
List of PortProfile instances present in the device. In the returned list of objects only the following associations will be available.
•
NetworkInterfaceName
•
PortSetting
•
PortCapability
•
BasePortProfileRef
•
Collection of inherited Network Interface link.
getPortProfilesInNetworkElements
Returns a collection of port-profiles objects present in a network element.
ValidationException is thrown if the argument passed is null or it is not a valid network element InstanceNameId.
Parameters
opContext—Current Operational context
neInstanceNameIdCol—List of InstanceNameId corresponding to the network elements
Return Value
List of PortProfile instances present in the device. In the returned list of objects only the following associations will be available.
•
NetworkInterfaceName
•
PortSetting
•
PortCapability
•
BasePortProfileRef
•
Collection of inherited Network Interface link.
modifyPortProfiles
Modifies one or more port-profile objects.
ValidationException is thrown if any of the following situation occurs:
•
If the modifiedProfileCol is null or the collection is empty.
•
If the modifiedProfileCol contains one or more null element, or the collection contains objects that are not of type PortProfile.
•
If the modifiedProfileCol contains one or more PortProfile objects without AbstractNetworkElement association.
Parameters
opContext—Current Operational context
modifiedProfileCol—List of PortProfile instances which are modified. .
Return Value
void.
modifyProfileModeToRouted
Modify the port mode from switched to routed for a given port profile.
ValidationException is thrown if any of the following situation occurs:
•
If switchedProfileNameIdCol collection is null or it is empty.
•
If switchedProfileNameIdCol collection contains an object that is not of type SwitchedPortProfile InstanceName id.
•
If switchedProfileNameIdCol collection contains a SwitchedPortProfile that does not exist in the database.
Parameters
opContext—Current Operational context
switchedProfileNameIdCol—List of instance name Ids of switched profiles.
Return Value
List of new routed ports.
modifyProfileModeToSwitched
Modify the port mode from routed to switched for a given port profile.
ValidationException is thrown if any of the following situation occurs:
•
If routedProfileNameIdCol collection is null or it is empty.
•
If routedProfileNameIdCol collection contains an object that is not of type RoutedPortProfile InstanceName id.
•
If routedProfileNameIdCol collection contains a RoutedPortProfile that does not exist in the database.
Parameters
opContext—Current Operational context.
routedProfileNameIdCol—List of instance name Ids of routed ports.
switchProfileMode—Switchport mode.
trunkMode—Trunk port mode. Based on this mode, trunk encapsulation and non-negotiate will be set to corresponding defaults.
Return Value
List of newly created switched profiles .
modifySwitchPortMode
Modify the switch port mode for a given list of switch profiles.
ValidationException is thrown if any of the following situation occurs:
•
If switchedProfileNameIdCol collection is null or it is empty.
•
If switchedProfileNameIdCol collection contains an object that is not of type SwitchedPortProfile InstanceName id.
•
If switchedProfileNameIdCol collection contains a SwitchedPortProfile that does not exist in the database.
Parameters
opContext—Current Operational context
switchedProfileNameIdCol—List of instance name Ids of switched profile
switchProfileMode—New switchport mode
trunkMode—Trunk port mode. This is applicable only if the mode is changed to trunk mode. Based on this mode set, trunk encapsulation and non-negotiate will be set to corresponding defaults.
Return Value
void.
unbindInterfacesWithPortProfile
Disassociate a instance associated to PortProfile instances existing in the same device. ValidationException is thrown if any of the following situation occurs:
•
If niInstanceNameIds is null or it is empty.
•
If niInstanceNameIds contains invalid NetworkInterface InstanceNameId or null value.
•
If there is no equivalent NetworkInterface object with the given InstanceNameId in the niInstanceNameIds.
Parameters
opContext—Current Operational context
niInstanceNameIds—List of InstanceNameId of network interfaces which need to be un-associated to profile.
Return Value
void.
unbindPortProfileWithBasePortProfile
Disassociate a PortProfile instance associated to PortProfile instance as parent, existing in the same device.
ValidationException is thrown if any of the following situation occurs:
•
If subProfileInstanceNameIds is null or it is empty.
•
If subProfileInstanceNameIds contains invalid PortProfile InstanceNameId or null value.
•
If there is no equivalent PortProfile object with the given InstanceNameId in the subProfileInstanceNameId.
Parameters
opContext—Current Operational context
subProfileInstanceNameIds—List of InstanceNameId of port-profiles which need to be un-associated from parent profile.
Return Value
void.