diff --git a/authentication/powershell/intersight_authentication.ps1 b/authentication/powershell/intersight_authentication.ps1 deleted file mode 100644 index 5fb9737..0000000 --- a/authentication/powershell/intersight_authentication.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -$onprem = @{ - BasePath = "https://intersight.com" - ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" - ApiKeyFilePath = "C:\\secretKey.txt" - HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") -} - -Set-IntersightConfiguration @onprem - -# use -SkipCertificateCheck to bypass the SSL certificate check. - -Get-IntersightConfiguration - -BasePath : https://intersight.com -ApiKeyId : xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx -ApiKeyFilePath : C:\\secretKey.txt -ApiKeyPassPhrase : -Proxy : -HashAlgorithm : SHA256 -HttpSigningHeader : {"(request-target)", "Host", "Date", "Digest"} -SignatureValidityPeriod : 0 \ No newline at end of file diff --git a/authentication/python/intersight_authentication.py b/authentication/python/intersight_authentication.py deleted file mode 100644 index 5000d17..0000000 --- a/authentication/python/intersight_authentication.py +++ /dev/null @@ -1,38 +0,0 @@ -import intersight -import re - - -def get_api_client(api_key_id, api_secret_file, endpoint="https://intersight.com"): - with open(api_secret_file, 'r') as f: - api_key = f.read() - - if re.search('BEGIN RSA PRIVATE KEY', api_key): - # API Key v2 format - signing_algorithm = intersight.signing.ALGORITHM_RSASSA_PKCS1v15 - signing_scheme = intersight.signing.SCHEME_RSA_SHA256 - hash_algorithm = intersight.signing.HASH_SHA256 - - elif re.search('BEGIN EC PRIVATE KEY', api_key): - # API Key v3 format - signing_algorithm = intersight.signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 - signing_scheme = intersight.signing.SCHEME_HS2019 - hash_algorithm = intersight.signing.HASH_SHA256 - - configuration = intersight.Configuration( - host=endpoint, - signing_info=intersight.signing.HttpSigningConfiguration( - key_id=api_key_id, - private_key_path=api_secret_file, - signing_scheme=signing_scheme, - signing_algorithm=signing_algorithm, - hash_algorithm=hash_algorithm, - signed_headers=[ - intersight.signing.HEADER_REQUEST_TARGET, - intersight.signing.HEADER_HOST, - intersight.signing.HEADER_DATE, - intersight.signing.HEADER_DIGEST, - ] - ) - ) - - return intersight.ApiClient(configuration) \ No newline at end of file diff --git a/index.json b/index.json index 83cb8df..af1a45a 100644 --- a/index.json +++ b/index.json @@ -1,16 +1,6 @@ { + "tabs":["powershell","python","terraform"], "directories": [ - { - "name":"authentication", - "displayName": "Authentication", - "codesample":{ - "ansible": "intersight_authentication.yaml", - "openapi": "intersight_authentication.json", - "powershell": "intersight_authentication.ps1", - "python":"intersight_authentication.py", - "terraform": "intersight_authentication.tf" - } - }, { "name": "profile", "displayName": "Profile", @@ -80,550 +70,600 @@ ] }, { - "name": "ucs_domain", - "displayName": "UCS Domain", - "subDirectories": [ - { - "name": "flow_control_policy", - "displayName": "Flow control Policy", - "sampleCode": { - "ansible": "flow_control_policy.yaml", - "python": "flow_control_policy.py", - "powershell": "flow_control_policy.ps1", - "terraform": "flow_control_policy.tf", - "openapi": "flow_control_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "link_aggregation_policy", - "displayName": "Link Aggregation Policy", - "sampleCode": { - "ansible": "link_aggregation_policy.yaml", - "python": "link_aggregation_policy.py", - "powershell": "link_aggregation_policy.ps1", - "terraform": "link_aggregation_policy.tf", - "openapi": "link_aggregation_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "link_control_policy", - "displayName": "Link Control Policy", - "sampleCode": { - "ansible": "link_control_policy.yaml", - "python": "link_control_policy.py", - "powershell": "link_control_policy.ps1", - "terraform": "link_control_policy.tf", - "openapi": "link_control_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "multicast_policy", - "displayName": "Multicast Policy", - "sampleCode": { - "ansible": "multicast_policy.yaml", - "python": "multicast_policy.py", - "powershell": "multicast_policy.ps1", - "terraform": "multicast_policy.tf", - "openapi": "multicast_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "network_connectivity_policy", - "displayName": "Network Connectivity Policy", - "codeSample": { - "ansible": "network_connectivity_policy.yaml", - "python": "network_connectivity_policy.py", - "powershell": "network_connectivity_policy.ps1", - "terraform": "network_connectivity_policy.tf", - "openapi": "network_connectivity_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "network_control_policy", - "displayName": "Network Control Policy", - "codeSample": { - "ansible": "network_control_policy.yaml", - "python": "network_control_policy.py", - "powershell": "network_control_policy.ps1", - "terraform": "network_control_policy.tf", - "openapi": "network_control_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "network_group_policy", - "displayName": "Network Group Policy", - "codeSample": { - "ansible": "network_group_policy.yaml", - "python": "network_group_policy.py", - "powershell": "network_group_policy.ps1", - "terraform": "network_group_policy.tf", - "openapi": "network_group_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "ntp_policy", - "displayName": "NTP Policy", - "codeSample": { - "ansible": "ntp_policy.yaml", - "python": "ntp_policy.py", - "powershell": "ntp_policy.ps1", - "terraform": "ntp_policy.tf", - "openapi": "ntp_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "port_policy", - "displayName": "Port Policy", - "codeSample": { - "ansible": "port_policy.yaml", - "python": "port_policy.py", - "powershell": "port_policy.ps1", - "terraform": "port_policy.tf", - "openapi": "port_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "snmp_policy", - "displayName": "SNMP Policy", - "codeSample": { - "ansible": "snmp_policy.yaml", - "python": "snmp_policy.py", - "powershell": "snmp_policy.ps1", - "terraform": "snmp_policy.tf", - "openapi": "snmp_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "switch_control_policy", - "displayName": "Switch Control Policy", - "codeSample": { - "ansible": "switch_control_policy.yaml", - "python": "switch_control_policy.py", - "powershell": "switch_control_policy.ps1", - "terraform": "switch_control_policy.tf", - "openapi": "switch_control_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "syslog_policy", - "displayName": "Syslog Policy", - "codeSample": { - "ansible": "syslog_policy.yaml", - "python": "syslog_policy.py", - "powershell": "syslog_policy.ps1", - "terraform": "syslog_policy.tf", - "openapi": "syslog_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "system_qos_policy", - "displayName": "System Qos Policy", - "codeSample": { - "ansible": "system_qos_policy.yaml", - "python": "system_qos_policy.py", - "powershell": "system_qos_policy.ps1", - "terraform": "system_qos_policy.tf", - "openapi": "system_qos_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "vlan_configuration_policy", - "displayName": "Vlan Configuration Policy", - "codeSample": { - "ansible": "vlan_configuration_policy.yaml", - "python": "vlan_configuration_policy.py", - "powershell": "vlan_configuration_policy.ps1", - "terraform": "vlan_configuration_policy.tf", - "openapi": "vlan_configuration_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "vsan_configuration_policy", - "displayName": "VSAN Configuration Policy", - "codeSample": { - "ansible": "vsan_configuration_policy.yaml", - "python": "vsan_configuration_policy.py", - "powershell": "vsan_configuration_policy.ps1", - "terraform": "vsan_configuration_policy.tf", - "openapi": "vsan_configuration_policy.json" - }, - "files": [ - "readme.md" - ] - } - ] - }, - { - "name": "ucs_server", - "displayName": "UCS Server", + "name": "policies", + "displayName": "Policies", "subDirectories": [ { - "name": "compute", - "displayName": "Compute", + "name": "ucs_server_policies", + "displayName": "UCS Server", + "showAnchors": true, "subDirectories": [ { - "name": "bios_policy", - "displayName": "Bios Policy", - "codeSample": { - "ansible": "bios_policy.yaml", - "python": "bios_policy.py", - "powershell": "bios_policy.ps1", - "terraform": "bios_policy.tf", - "openapi": "bios_policy.json" - }, - "files": [ - "readme.md" + "name": "compute", + "displayName": "Compute", + "subDirectories": [ + { + "name": "bios_policy", + "displayName": "Bios Policy", + "descriptions": "Automates the configuration of BIOS settings on the managed devices. You can create one or more BIOS policies which contain a specific grouping of BIOS settings. If you do not specify a BIOS policy for a server, the BIOS settings remain as they are. If a BIOS policy is specified, the values that are specified in the policy replace any previously configured values on a server (including bare metal server configuration settings). To apply the BIOS policy settings, you must reboot the server.", + "codesample": { + "ansible": "bios_policy.yaml", + "python": "bios_policy.py", + "powershell": "bios_policy.ps1", + "terraform": "bios_policy.tf", + "openapi": "bios_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "boot_order_policy", + "displayName": "Boot Order Policy", + "descriptions": "Configures the linear ordering of devices and enables you to change the boot order and boot mode. You can also add multiple devices under various device types, rearrange the boot order, and set parameters for each boot device type.", + "codesample": { + "ansible": "boot_order_policy.yaml", + "python": "boot_order_policy.py", + "powershell": "boot_order_policy.ps1", + "terraform": "boot_order_policy.tf", + "openapi": "boot_order_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "power_policy", + "displayName": "Power Policy", + "descriptions": "Enables the management of power for FI-attached servers and chassis. This policy allows you to set the power profiling the power priority of the server, and the power restore state of the system", + "codesample": { + "ansible": "power_policy.yaml", + "python": "power_policy.py", + "powershell": "power_policy.ps1", + "terraform": "power_policy.tf", + "openapi": "power_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "virtual_media_policy", + "displayName": "Virtual Media Policy", + "descriptions": "Enables you to install an Operating System on the server using the KVM console and virtual media, mount files to the host from a remote file share, and enable virtual media encryption. You can create one or more Virtual Media policies, which can contain virtual media mappings for different OS images, and configure up to two virtual media mappings, one for ISO files (through CDD), and the other for IMG files (through HDD).", + "codesample": { + "ansible": "virtual_media_policy.yaml", + "python": "virtual_media_policy.py", + "powershell": "virtual_media_policy.ps1", + "terraform": "virtual_media_policy.tf", + "openapi": "virtual_media_policy.json" + }, + "files": [ + "readme.md" + ] + } ] }, { - "name": "boot_order_policy", - "displayName": "Boot Order Policy", - "codeSample": { - "ansible": "boot_order_policy.yaml", - "python": "boot_order_policy.py", - "powershell": "boot_order_policy.ps1", - "terraform": "boot_order_policy.tf", - "openapi": "boot_order_policy.json" - }, - "files": [ - "readme.md" + "name": "management", + "displayName": "Management", + "subDirectories": [ + { + "name": "imc_access_policy", + "displayName": "IMC Access Policy", + "descriptions": "Enables to manage and configure your network through mapping of IP pools to the server profile. This policy allows you to configure a VLAN and associate it with an IP address through the IP pool address.", + "codesample": { + "ansible": "imc_access_policy.yaml", + "python": "imc_access_policy.py", + "powershell": "imc_access_policy.ps1", + "terraform": "imc_access_policy.tf", + "openapi": "imc_access_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "ipmi_over_lan_policy", + "displayName": "IPMI Over LAN Policy", + "descriptions": "Defines the protocols for interfacing with a service processor that is embedded in a server platform. The Intelligent Platform Management Interface (IPMI) enables an operating system to obtain information about the system health and control system hardware and directs the Cisco IMC to perform the required actions. You can create an IPMI Over LAN policy to manage the IPMI messages through Cisco Intersight.", + "codesample": { + "ansible": "ipmi_over_lan_policy.yaml", + "python": "ipmi_over_lan_policy.py", + "powershell": "ipmi_over_lan_policy.ps1", + "terraform": "ipmi_over_lan_policy.tf", + "openapi": "ipmi_over_lan_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "local_user_policy", + "displayName": "Local User Policy", + "descriptions": "Automates the configuration of local user preferences. You can create one or more Local User policies which contain a list of local users that need to be configured.", + "codesample": { + "ansible": "local_user_policy.yaml", + "python": "local_user_policy.py", + "powershell": "local_user_policy.ps1", + "terraform": "local_user_policy.tf", + "openapi": "local_user_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "serial_over_lan_policy", + "displayName": "Serial Over LAN Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "serial_over_lan_policy.yaml", + "python": "serial_over_lan_policy.py", + "powershell": "serial_over_lan_policy.ps1", + "terraform": "serial_over_lan_policy.tf", + "openapi": "serial_over_lan_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "snmp_policy", + "displayName": "SNMP Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "snmp_policy.yaml", + "python": "snmp_policy.py", + "powershell": "snmp_policy.ps1", + "terraform": "snmp_policy.tf", + "openapi": "snmp_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "syslog_policy", + "displayName": "Syslog Policy", + "descriptions": "Defines the logging level (minimum severity) to report for a log file collected from an endpoint, the target destination to store the Syslog messages, and the Hostname/IP Address, port information, and communication protocol for the Remote Logging Server(s).", + "codesample": { + "ansible": "syslog_policy.yaml", + "python": "syslog_policy.py", + "powershell": "syslog_policy.ps1", + "terraform": "syslog_policy.tf", + "openapi": "syslog_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "virtual_kvm_policy", + "displayName": "Virtual KVM Policy", + "descriptions": "Enables specific grouping of virtual KVM properties. This policy allows you specify the number of allowed concurrent KVM sessions, port information, and video encryption options.", + "codesample": { + "ansible": "virtual_kvm_policy.yaml", + "python": "virtual_kvm_policy.py", + "powershell": "virtual_kvm_policy.ps1", + "terraform": "virtual_kvm_policy.tf", + "openapi": "virtual_kvm_policy.json" + }, + "files": [ + "readme.md" + ] + } ] }, { - "name": "power_policy", - "displayName": "Power Policy", - "codeSample": { - "ansible": "power_policy.yaml", - "python": "power_policy.py", - "powershell": "power_policy.ps1", - "terraform": "power_policy.tf", - "openapi": "power_policy.json" - }, - "files": [ - "readme.md" + "name": "misc", + "displayName": "misc", + "subDirectories": [ + { + "name": "ldap_policy", + "displayName": "LDAP Policy", + "descriptions": "Specifies the LDAP configuration settings and preferences for an endpoint. The endpoints support LDAP to store and maintain directory information in a network. The LDAP policy determines configuration settings for LDAP Servers, DNS parameters including options to obtain a domain name used for the DNS SRV request, Binding methods, Search parameters, and Group Authorization preferences. Through an LDAP policy, you can also create multiple LDAP groups and add them to the LDAP server database.", + "codesample": { + "ansible": "ldap_policy.yaml", + "python": "ldap_policy.py", + "powershell": "ldap_policy.ps1", + "terraform": "ldap_policy.tf", + "openapi": "ldap_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "ntp_policy", + "displayName": "Ntp Policy", + "descriptions": "Allows you to enable the NTP service on an Intersight Managed Cisco IMC (Standalone) server. The NTP service synchronizes the time with an NTP server. You must enable and configure the NTP service by specifying the IP address or DNS of a minimum of one to a maximum of four NTP servers.", + "codesample": { + "ansible": "ntp_policy.yaml", + "python": "ntp_policy.py", + "powershell": "ntp_policy.ps1", + "terraform": "ntp_policy.tf", + "openapi": "ntp_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "smtp_policy", + "displayName": "SMTP Policy", + "descriptions": "Sets the state of the SMTP client in the managed device. You can specify the preferred settings for outgoing communication and select the fault severity level to report and the mail recipients.", + "codesample": { + "ansible": "smtp_policy.yaml", + "python": "smtp_policy.py", + "powershell": "smtp_policy.ps1", + "terraform": "smtp_policy.tf", + "openapi": "smtp_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "ssh_policy", + "displayName": "SSH Policy", + "descriptions": "Enables an SSH client to make a secure, encrypted connection. You can create one or more SSH policies that contain a specific grouping of SSH properties for a server or a set of servers.", + "codesample": { + "ansible": "ssh_policy.yaml", + "python": "ssh_policy.py", + "powershell": "ssh_policy.ps1", + "terraform": "ssh_policy.tf", + "openapi": "ssh_policy.json" + }, + "files": [ + "readme.md" + ] + } ] }, { - "name": "virtual_media_policy", - "displayName": "Virtual Media Policy", - "codeSample": { - "ansible": "virtual_media_policy.yaml", - "python": "virtual_media_policy.py", - "powershell": "virtual_media_policy.ps1", - "terraform": "virtual_media_policy.tf", - "openapi": "virtual_media_policy.json" - }, - "files": [ - "readme.md" - ] - } - ] - }, - { - "name": "management", - "displayName": "Management", - "subDirectories": [ - { - "name": "imc_access_policy", - "displayName": "IMC Access Policy", - "codeSample": { - "ansible": "imc_access_policy.yaml", - "python": "imc_access_policy.py", - "powershell": "imc_access_policy.ps1", - "terraform": "imc_access_policy.tf", - "openapi": "imc_access_policy.json" - }, - "files": [ - "readme.md" + "name": "network", + "displayName": "Network", + "subDirectories": [ + { + "name": "adapter_configuration_policy", + "displayName": "Adapter Configuration Policy", + "descriptions": "Configures the Ethernet and Fibre-Channel settings for the VIC adapter", + "codesample": { + "ansible": "adapter_configuration_policy.yaml", + "python": "adapter_configuration_policy.py", + "powershell": "adapter_configuration_policy.ps1", + "terraform": "adapter_configuration_policy.tf", + "openapi": "adapter_configuration_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "ethernet_adapter_policy", + "displayName": "Ethernet Adapter Policy", + "descriptions": "Governs the host-side behavior of the adapter, including how the adapter handles traffic. For each VIC Virtual Ethernet Interface, you can configure various features such as VXLAN, NVGRE, ARFS, Interrupt settings, and TCP Offload settings.", + "codesample": { + "ansible": "ethernet_adapter_policy.yaml", + "python": "ethernet_adapter_policy.py", + "powershell": "ethernet_adapter_policy.ps1", + "terraform": "ethernet_adapter_policy.tf", + "openapi": "ethernet_adapter_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "ethernet_network_control_policy", + "displayName": "Ethernet Network Control Policy", + "descriptions": "Configures the network control settings for the appliance ports, appliance port channels, or vNICs.", + "codesample": { + "ansible": "ethernet_network_control_policy.yaml", + "python": "ethernet_network_control_policy.py", + "powershell": "ethernet_network_control_policy.ps1", + "terraform": "ethernet_network_control_policy.tf", + "openapi": "ethernet_network_control_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "ethernet_network_group_policy", + "displayName": "Ethernet Network Group Policy", + "descriptions": "Configures the VLAN settings that include Native VLAN and QinQ VLAN for appliance ports, appliance port channels, or vNICs.", + "codesample": { + "ansible": "ethernet_network_group_policy.yaml", + "python": "ethernet_network_group_policy.py", + "powershell": "ethernet_network_group_policy.ps1", + "terraform": "ethernet_network_group_policy.tf", + "openapi": "ethernet_network_group_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "ethernet_network_policy", + "displayName": "Ethernet Network Policy", + "descriptions": "Allows to define the port to carry single VLAN(Access) or multiple VLANs(Trunk) traffic. You can configure the Default VLAN and QinQ VLAN settings for vNICs. You can specify the VLAN to be associated with an Ethernet packet if no tag is found.", + "codesample": { + "ansible": "ethernet_network_policy.yaml", + "python": "ethernet_network_policy.py", + "powershell": "ethernet_network_policy.ps1", + "terraform": "ethernet_network_policy.tf", + "openapi": "ethernet_network_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "ethernet_qos_policy", + "displayName": "Ethernet Qos Policy", + "descriptions": "Assigns a system class to the outgoing traffic for a vNIC. This system class determines the quality of service for the outgoing traffic. For certain adapters, you can also specify additional controls like burst and rate on the outgoing traffic.", + "codesample": { + "ansible": "ethernet_qos_policy.yaml", + "python": "ethernet_qos_policy.py", + "powershell": "ethernet_qos_policy.ps1", + "terraform": "ethernet_qos_policy.tf", + "openapi": "ethernet_qos_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "lan_connectivity_policy", + "displayName": "LAN Connectivity Policy", + "descriptions": "Determines the connections and the network communication resources between the server and the LAN on the network. You must create the Ethernet Adapter, Ethernet QoS, and Ethernet Network policies as part of the LAN connectivity policy.", + "codesample": { + "ansible": "lan_connectivity_policy.yaml", + "python": "lan_connectivity_policy.py", + "powershell": "lan_connectivity_policy.ps1", + "terraform": "lan_connectivity_policy.tf", + "openapi": "lan_connectivity_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "network_connectivity_policy", + "displayName": "Network Connectivity Policy", + "descriptions": "Specifies the DNS Domain settings that are used to add or update the resource records on the DNS server from the endpoints, and the DNS server settings for IPv4 and IPv6 on an endpoint.", + "codesample": { + "ansible": "network_connectivity_policy.yaml", + "python": "network_connectivity_policy.py", + "powershell": "network_connectivity_policy.ps1", + "terraform": "network_connectivity_policy.tf", + "openapi": "network_connectivity_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "san_connectivity_policy", + "displayName": "SAN Connectivity Policy", + "descriptions": "Determines the network storage resources and the connections between the server and the SAN on the network.", + "codesample": { + "ansible": "san_connectivity_policy.yaml", + "python": "san_connectivity_policy.py", + "powershell": "san_connectivity_policy.ps1", + "terraform": "san_connectivity_policy.tf", + "openapi": "san_connectivity_policy.json" + }, + "files": [ + "readme.md" + ] + } ] }, { - "name": "ipmi_over_lan_policy", - "displayName": "IPMI Over LAN Policy", - "codeSample": { - "ansible": "ipmi_over_lan_policy.yaml", - "python": "ipmi_over_lan_policy.py", - "powershell": "ipmi_over_lan_policy.ps1", - "terraform": "ipmi_over_lan_policy.tf", - "openapi": "ipmi_over_lan_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "local_user_policy", - "displayName": "Local User Policy", - "codeSample": { - "ansible": "local_user_policy.yaml", - "python": "local_user_policy.py", - "powershell": "local_user_policy.ps1", - "terraform": "local_user_policy.tf", - "openapi": "local_user_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "serial_over_lan_policy", - "displayName": "Serial Over LAN Policy", - "codeSample": { - "ansible": "serial_over_lan_policy.yaml", - "python": "serial_over_lan_policy.py", - "powershell": "serial_over_lan_policy.ps1", - "terraform": "serial_over_lan_policy.tf", - "openapi": "serial_over_lan_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "snmp_policy", - "displayName": "SNMP Policy", - "codeSample": { - "ansible": "snmp_policy.yaml", - "python": "snmp_policy.py", - "powershell": "snmp_policy.ps1", - "terraform": "snmp_policy.tf", - "openapi": "snmp_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "syslog_policy", - "displayName": "Syslog Policy", - "codeSample": { - "ansible": "syslog_policy.yaml", - "python": "syslog_policy.py", - "powershell": "syslog_policy.ps1", - "terraform": "syslog_policy.tf", - "openapi": "syslog_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "virtual_kvm_policy", - "displayName": "Virtual KVM Policy", - "codeSample": { - "ansible": "virtual_kvm_policy.yaml", - "python": "virtual_kvm_policy.py", - "powershell": "virtual_kvm_policy.ps1", - "terraform": "virtual_kvm_policy.tf", - "openapi": "virtual_kvm_policy.json" - }, - "files": [ - "readme.md" + "name": "storage", + "displayName": "Storage", + "subDirectories": [ + { + "name": "device_connector_policy", + "displayName": "Device Connector Policy", + "descriptions": "Lets you choose the Configuration from Intersight only option to control configuration changes allowed from Cisco IMC.", + "codesample": { + "ansible": "device_connector_policy.yaml", + "python": "device_connector_policy.py", + "powershell": "device_connector_policy.ps1", + "terraform": "device_connector_policy.tf", + "openapi": "device_connector_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "fiber_channel_adapter_policy", + "displayName": "Fiber Channel Adapter Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "fiber_channel_adapter_policy.yaml", + "python": "fiber_channel_adapter_policy.py", + "powershell": "fiber_channel_adapter_policy.ps1", + "terraform": "fiber_channel_adapter_policy.tf", + "openapi": "fiber_channel_adapter_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "fiber_channel_network_policy", + "displayName": "Fiber Channel Network Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "fiber_channel_network_policy.yaml", + "python": "fiber_channel_network_policy.py", + "powershell": "fiber_channel_network_policy.ps1", + "terraform": "fiber_channel_network_policy.tf", + "openapi": "fiber_channel_network_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "fiber_channel_qos_policy", + "displayName": "Fiber Channel Qos Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "fiber_channel_qos_policy.yaml", + "python": "fiber_channel_qos_policy.py", + "powershell": "fiber_channel_qos_policy.ps1", + "terraform": "fiber_channel_qos_policy.tf", + "openapi": "fiber_channel_qos_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "iscsi_adapter_policy", + "displayName": "ISCSI Adapter Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "iscsi_adapter_policy.yaml", + "python": "iscsi_adapter_policy.py", + "powershell": "iscsi_adapter_policy.ps1", + "terraform": "iscsi_adapter_policy.tf", + "openapi": "iscsi_adapter_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "iscsi_boot_policy", + "displayName": "ISCSI Boot Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "iscsi_boot_policy.yaml", + "python": "iscsi_boot_policy.py", + "powershell": "iscsi_boot_policy.ps1", + "terraform": "iscsi_boot_policy.tf", + "openapi": "iscsi_boot_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "iscsi_static_target_policy", + "displayName": "ISCSI Static Target Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "iscsi_static_target_policy.yaml", + "python": "iscsi_static_target_policy.py", + "powershell": "iscsi_static_target_policy.ps1", + "terraform": "iscsi_static_target_policy.tf", + "openapi": "iscsi_static_target_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "sd_card_policy", + "displayName": "SD Card Policy", + "descriptions": "Configures the Cisco FlexFlash and FlexUtil Secure Digital (SD) cards for the Cisco UCS C-Series Standalone M4 and M5 servers.", + "codesample": { + "ansible": "sd_card_policy.yaml", + "python": "sd_card_policy.py", + "powershell": "sd_card_policy.ps1", + "terraform": "sd_card_policy.tf", + "openapi": "sd_card_policy.json" + }, + "files": [ + "readme.md" + ] + }, + { + "name": "storage_policy", + "displayName": "Storage Policy", + "descriptions": "A Storage policy allows you to create drive groups, virtual drives, configure the storage capacity of a virtual drive, and configure the M.2 RAID controllers.", + "codesample": { + "ansible": "storage_policy.yaml", + "python": "storage_policy.py", + "powershell": "storage_policy.ps1", + "terraform": "storage_policy.tf", + "openapi": "storage_policy.json" + }, + "files": [ + "readme.md" + ] + } ] } ] }, { - "name": "misc", - "displayName": "misc", + "name": "ucs_domain_policies", + "displayName": "UCS Domain", "subDirectories": [ { - "name": "ldap_policy", - "displayName": "LDAP Policy", - "codeSample": { - "ansible": "ldap_policy.yaml", - "python": "ldap_policy.py", - "powershell": "ldap_policy.ps1", - "terraform": "ldap_policy.tf", - "openapi": "ldap_policy.json" + "name": "flow_control_policy", + "displayName": "Flow control Policy", + "descriptions": "Enables configurations for Priority Flow Control for ports and port channels.", + "codesample": { + "ansible": "flow_control_policy.yaml", + "python": "flow_control_policy.py", + "powershell": "flow_control_policy.ps1", + "terraform": "flow_control_policy.tf", + "openapi": "flow_control_policy.json" }, "files": [ "readme.md" ] }, { - "name": "ntp_policy", - "displayName": "Ntp Policy", - "codeSample": { - "ansible": "ntp_policy.yaml", - "python": "ntp_policy.py", - "powershell": "ntp_policy.ps1", - "terraform": "ntp_policy.tf", - "openapi": "ntp_policy.json" + "name": "link_aggregation_policy", + "displayName": "Link Aggregation Policy", + "descriptions": "Enables to configure Link Aggregation properties. Link Aggregation combines multiple network connections in parallel to increase throughput and to provide redundancy.", + "codesample": { + "ansible": "link_aggregation_policy.yaml", + "python": "link_aggregation_policy.py", + "powershell": "link_aggregation_policy.ps1", + "terraform": "link_aggregation_policy.tf", + "openapi": "link_aggregation_policy.json" }, "files": [ "readme.md" ] }, { - "name": "smtp_policy", - "displayName": "SMTP Policy", - "codeSample": { - "ansible": "smtp_policy.yaml", - "python": "smtp_policy.py", - "powershell": "smtp_policy.ps1", - "terraform": "smtp_policy.tf", - "openapi": "smtp_policy.json" + "name": "link_control_policy", + "displayName": "Link Control Policy", + "descriptions": "Enables configurations of Link Control administrative state and configuration (normal or aggressive) mode for ports.", + "codesample": { + "ansible": "link_control_policy.yaml", + "python": "link_control_policy.py", + "powershell": "link_control_policy.ps1", + "terraform": "link_control_policy.tf", + "openapi": "link_control_policy.json" }, "files": [ "readme.md" ] }, { - "name": "ssh_policy", - "displayName": "SSH Policy", - "codeSample": { - "ansible": "ssh_policy.yaml", - "python": "ssh_policy.py", - "powershell": "ssh_policy.ps1", - "terraform": "ssh_policy.tf", - "openapi": "ssh_policy.json" - }, - "files": [ - "readme.md" - ] - } - ] - }, - { - "name": "network", - "displayName": "Network", - "subDirectories": [ - { - "name": "adapter_configuration_policy", - "displayName": "Adapter Configuration Policy", - "codeSample": { - "ansible": "adapter_configuration_policy.yaml", - "python": "adapter_configuration_policy.py", - "powershell": "adapter_configuration_policy.ps1", - "terraform": "adapter_configuration_policy.tf", - "openapi": "adapter_configuration_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "ethernet_adapter_policy", - "displayName": "Ethernet Adapter Policy", - "codeSample": { - "ansible": "ethernet_adapter_policy.yaml", - "python": "ethernet_adapter_policy.py", - "powershell": "ethernet_adapter_policy.ps1", - "terraform": "ethernet_adapter_policy.tf", - "openapi": "ethernet_adapter_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "ethernet_network_control_policy", - "displayName": "Ethernet Network Control Policy", - "codeSample": { - "ansible": "ethernet_network_control_policy.yaml", - "python": "ethernet_network_control_policy.py", - "powershell": "ethernet_network_control_policy.ps1", - "terraform": "ethernet_network_control_policy.tf", - "openapi": "ethernet_network_control_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "ethernet_network_group_policy", - "displayName": "Ethernet Network Group Policy", - "codeSample": { - "ansible": "ethernet_network_group_policy.yaml", - "python": "ethernet_network_group_policy.py", - "powershell": "ethernet_network_group_policy.ps1", - "terraform": "ethernet_network_group_policy.tf", - "openapi": "ethernet_network_group_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "ethernet_network_policy", - "displayName": "Ethernet Network Policy", - "codeSample": { - "ansible": "ethernet_network_policy.yaml", - "python": "ethernet_network_policy.py", - "powershell": "ethernet_network_policy.ps1", - "terraform": "ethernet_network_policy.tf", - "openapi": "ethernet_network_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "ethernet_qos_policy", - "displayName": "Ethernet Qos Policy", - "codeSample": { - "ansible": "ethernet_qos_policy.yaml", - "python": "ethernet_qos_policy.py", - "powershell": "ethernet_qos_policy.ps1", - "terraform": "ethernet_qos_policy.tf", - "openapi": "ethernet_qos_policy.json" - }, - "files": [ - "readme.md" - ] - }, - { - "name": "lan_connectivity_policy", - "displayName": "LAN Connectivity Policy", - "codeSample": { - "ansible": "lan_connectivity_policy.yaml", - "python": "lan_connectivity_policy.py", - "powershell": "lan_connectivity_policy.ps1", - "terraform": "lan_connectivity_policy.tf", - "openapi": "lan_connectivity_policy.json" + "name": "multicast_policy", + "displayName": "Multicast Policy", + "descriptions": "Configures Internet Group Management Protocol (IGMP) snooping and IGMP querier. IGMP Snooping dynamically determines hosts in a VLAN that should be included in multicast transmissions.", + "codesample": { + "ansible": "multicast_policy.yaml", + "python": "multicast_policy.py", + "powershell": "multicast_policy.ps1", + "terraform": "multicast_policy.tf", + "openapi": "multicast_policy.json" }, "files": [ "readme.md" @@ -632,7 +672,8 @@ { "name": "network_connectivity_policy", "displayName": "Network Connectivity Policy", - "codeSample": { + "descriptions": "Specifies the DNS Domain settings that are used to add or update the resource records on the DNS server from the endpoints, and the DNS server settings for IPv4 and IPv6 on an endpoint.", + "codesample": { "ansible": "network_connectivity_policy.yaml", "python": "network_connectivity_policy.py", "powershell": "network_connectivity_policy.ps1", @@ -644,146 +685,150 @@ ] }, { - "name": "san_connectivity_policy", - "displayName": "SAN Connectivity Policy", - "codeSample": { - "ansible": "san_connectivity_policy.yaml", - "python": "san_connectivity_policy.py", - "powershell": "san_connectivity_policy.ps1", - "terraform": "san_connectivity_policy.tf", - "openapi": "san_connectivity_policy.json" + "name": "network_control_policy", + "displayName": "Network Control Policy", + "descriptions": "Configures the network control settings for the appliance ports, appliance port channels, or vNICs.", + "codesample": { + "ansible": "network_control_policy.yaml", + "python": "network_control_policy.py", + "powershell": "network_control_policy.ps1", + "terraform": "network_control_policy.tf", + "openapi": "network_control_policy.json" }, "files": [ "readme.md" ] - } - ] - }, - { - "name": "storage", - "displayName": "Storage", - "subDirectories": [ + }, { - "name": "device_connector_policy", - "displayName": "Device Connector Policy", - "codeSample": { - "ansible": "device_connector_policy.yaml", - "python": "device_connector_policy.py", - "powershell": "device_connector_policy.ps1", - "terraform": "device_connector_policy.tf", - "openapi": "device_connector_policy.json" + "name": "network_group_policy", + "displayName": "Network Group Policy", + "descriptions": "Configures the VLAN settings that include Native VLAN and QinQ VLAN for appliance ports, appliance port channels, or vNICs.", + "codesample": { + "ansible": "network_group_policy.yaml", + "python": "network_group_policy.py", + "powershell": "network_group_policy.ps1", + "terraform": "network_group_policy.tf", + "openapi": "network_group_policy.json" }, "files": [ "readme.md" ] }, { - "name": "fiber_channel_adapter_policy", - "displayName": "Fiber Channel Adapter Policy", - "codeSample": { - "ansible": "fiber_channel_adapter_policy.yaml", - "python": "fiber_channel_adapter_policy.py", - "powershell": "fiber_channel_adapter_policy.ps1", - "terraform": "fiber_channel_adapter_policy.tf", - "openapi": "fiber_channel_adapter_policy.json" + "name": "ntp_policy", + "displayName": "NTP Policy", + "descriptions": "Allows you to enable the NTP service on an Intersight Managed Cisco IMC (Standalone) server.", + "codesample": { + "ansible": "ntp_policy.yaml", + "python": "ntp_policy.py", + "powershell": "ntp_policy.ps1", + "terraform": "ntp_policy.tf", + "openapi": "ntp_policy.json" }, "files": [ "readme.md" ] }, { - "name": "fiber_channel_network_policy", - "displayName": "Fiber Channel Network Policy", - "codeSample": { - "ansible": "fiber_channel_network_policy.yaml", - "python": "fiber_channel_network_policy.py", - "powershell": "fiber_channel_network_policy.ps1", - "terraform": "fiber_channel_network_policy.tf", - "openapi": "fiber_channel_network_policy.json" + "name": "port_policy", + "displayName": "Port Policy", + "descriptions": "Configures the ports and port roles for the Fabric Interconnect. Each Fabric Interconnect has a set of ports in a fixed port module that you can configure.", + "codesample": { + "ansible": "port_policy.yaml", + "python": "port_policy.py", + "powershell": "port_policy.ps1", + "terraform": "port_policy.tf", + "openapi": "port_policy.json" }, "files": [ "readme.md" ] }, { - "name": "fiber_channel_qos_policy", - "displayName": "Fiber Channel Qos Policy", - "codeSample": { - "ansible": "fiber_channel_qos_policy.yaml", - "python": "fiber_channel_qos_policy.py", - "powershell": "fiber_channel_qos_policy.ps1", - "terraform": "fiber_channel_qos_policy.tf", - "openapi": "fiber_channel_qos_policy.json" + "name": "snmp_policy", + "displayName": "SNMP Policy", + "descriptions": "Policy description", + "codesample": { + "ansible": "snmp_policy.yaml", + "python": "snmp_policy.py", + "powershell": "snmp_policy.ps1", + "terraform": "snmp_policy.tf", + "openapi": "snmp_policy.json" }, "files": [ "readme.md" ] }, { - "name": "iscsi_adapter_policy", - "displayName": "ISCSI Adapter Policy", - "codeSample": { - "ansible": "iscsi_adapter_policy.yaml", - "python": "iscsi_adapter_policy.py", - "powershell": "iscsi_adapter_policy.ps1", - "terraform": "iscsi_adapter_policy.tf", - "openapi": "iscsi_adapter_policy.json" + "name": "switch_control_policy", + "displayName": "Switch Control Policy", + "descriptions": "Enables to configure and manage multiple network operations on the Fabric Interconnects.", + "codesample": { + "ansible": "switch_control_policy.yaml", + "python": "switch_control_policy.py", + "powershell": "switch_control_policy.ps1", + "terraform": "switch_control_policy.tf", + "openapi": "switch_control_policy.json" }, "files": [ "readme.md" ] }, { - "name": "iscsi_boot_policy", - "displayName": "ISCSI Boot Policy", - "codeSample": { - "ansible": "iscsi_boot_policy.yaml", - "python": "iscsi_boot_policy.py", - "powershell": "iscsi_boot_policy.ps1", - "terraform": "iscsi_boot_policy.tf", - "openapi": "iscsi_boot_policy.json" + "name": "syslog_policy", + "displayName": "Syslog Policy", + "descriptions": "Defines the logging level (minimum severity) to report for a log file collected from an endpoint, the target destination to store the Syslog messages, and the Hostname/IP Address, port information, and communication protocol for the Remote Logging Server(s).", + "codesample": { + "ansible": "syslog_policy.yaml", + "python": "syslog_policy.py", + "powershell": "syslog_policy.ps1", + "terraform": "syslog_policy.tf", + "openapi": "syslog_policy.json" }, "files": [ "readme.md" ] }, { - "name": "iscsi_static_target_policy", - "displayName": "ISCSI Static Target Policy", - "codeSample": { - "ansible": "iscsi_static_target_policy.yaml", - "python": "iscsi_static_target_policy.py", - "powershell": "iscsi_static_target_policy.ps1", - "terraform": "iscsi_static_target_policy.tf", - "openapi": "iscsi_static_target_policy.json" + "name": "system_qos_policy", + "displayName": "System Qos Policy", + "descriptions": "mplements network traffic prioritization based on the importance of the connected network by assigning system classes for individual vNICs.", + "codesample": { + "ansible": "system_qos_policy.yaml", + "python": "system_qos_policy.py", + "powershell": "system_qos_policy.ps1", + "terraform": "system_qos_policy.tf", + "openapi": "system_qos_policy.json" }, "files": [ "readme.md" ] }, { - "name": "sd_card_policy", - "displayName": "SD Card Policy", - "codeSample": { - "ansible": "sd_card_policy.yaml", - "python": "sd_card_policy.py", - "powershell": "sd_card_policy.ps1", - "terraform": "sd_card_policy.tf", - "openapi": "sd_card_policy.json" + "name": "vlan_configuration_policy", + "displayName": "Vlan Configuration Policy", + "descriptions": "Creates a connection to a specific external LAN.", + "codesample": { + "ansible": "vlan_configuration_policy.yaml", + "python": "vlan_configuration_policy.py", + "powershell": "vlan_configuration_policy.ps1", + "terraform": "vlan_configuration_policy.tf", + "openapi": "vlan_configuration_policy.json" }, "files": [ "readme.md" ] }, { - "name": "storage_policy", - "displayName": "Storage Policy", - "codeSample": { - "ansible": "storage_policy.yaml", - "python": "storage_policy.py", - "powershell": "storage_policy.ps1", - "terraform": "storage_policy.tf", - "openapi": "storage_policy.json" + "name": "vsan_configuration_policy", + "displayName": "VSAN Configuration Policy", + "descriptions": "Partitions the Fibre Channel fabric into one or more zones. Each zone defines the set of Fibre Channel initiators and Fibre Channel targets that can communicate with each other in a VSAN.", + "codesample": { + "ansible": "vsan_configuration_policy.yaml", + "python": "vsan_configuration_policy.py", + "powershell": "vsan_configuration_policy.ps1", + "terraform": "vsan_configuration_policy.tf", + "openapi": "vsan_configuration_policy.json" }, "files": [ "readme.md" @@ -794,4 +839,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/ucs_domain/flow_control_policy/ansible/flow_control_policy.yaml b/policies/ucs_domain_policies/flow_control_policy/ansible/flow_control_policy.yaml similarity index 100% rename from ucs_domain/flow_control_policy/ansible/flow_control_policy.yaml rename to policies/ucs_domain_policies/flow_control_policy/ansible/flow_control_policy.yaml diff --git a/ucs_domain/flow_control_policy/openapi/flow_control_policy.json b/policies/ucs_domain_policies/flow_control_policy/openapi/flow_control_policy.json similarity index 100% rename from ucs_domain/flow_control_policy/openapi/flow_control_policy.json rename to policies/ucs_domain_policies/flow_control_policy/openapi/flow_control_policy.json diff --git a/ucs_domain/flow_control_policy/powershell/flow_control_policy.ps1 b/policies/ucs_domain_policies/flow_control_policy/powershell/flow_control_policy.ps1 similarity index 100% rename from ucs_domain/flow_control_policy/powershell/flow_control_policy.ps1 rename to policies/ucs_domain_policies/flow_control_policy/powershell/flow_control_policy.ps1 diff --git a/ucs_domain/flow_control_policy/python/flow_control_policy.py b/policies/ucs_domain_policies/flow_control_policy/python/flow_control_policy.py similarity index 90% rename from ucs_domain/flow_control_policy/python/flow_control_policy.py rename to policies/ucs_domain_policies/flow_control_policy/python/flow_control_policy.py index 3ac71b1..5c851a5 100644 --- a/ucs_domain/flow_control_policy/python/flow_control_policy.py +++ b/policies/ucs_domain_policies/flow_control_policy/python/flow_control_policy.py @@ -16,10 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_flow_control_policy(): api_instance = fabric_api.FabricApi(api_client) diff --git a/ucs_domain/flow_control_policy/readme.md b/policies/ucs_domain_policies/flow_control_policy/readme.md similarity index 100% rename from ucs_domain/flow_control_policy/readme.md rename to policies/ucs_domain_policies/flow_control_policy/readme.md diff --git a/ucs_domain/flow_control_policy/terraform/flow_control_policy.tf b/policies/ucs_domain_policies/flow_control_policy/terraform/flow_control_policy.tf similarity index 100% rename from ucs_domain/flow_control_policy/terraform/flow_control_policy.tf rename to policies/ucs_domain_policies/flow_control_policy/terraform/flow_control_policy.tf diff --git a/ucs_domain/link_aggregation_policy/ansible/link_aggregation_policy.yaml b/policies/ucs_domain_policies/link_aggregation_policy/ansible/link_aggregation_policy.yaml similarity index 100% rename from ucs_domain/link_aggregation_policy/ansible/link_aggregation_policy.yaml rename to policies/ucs_domain_policies/link_aggregation_policy/ansible/link_aggregation_policy.yaml diff --git a/ucs_domain/link_aggregation_policy/openapi/link_aggregation_policy.json b/policies/ucs_domain_policies/link_aggregation_policy/openapi/link_aggregation_policy.json similarity index 100% rename from ucs_domain/link_aggregation_policy/openapi/link_aggregation_policy.json rename to policies/ucs_domain_policies/link_aggregation_policy/openapi/link_aggregation_policy.json diff --git a/ucs_domain/link_aggregation_policy/powershell/link_aggregation_policy.ps1 b/policies/ucs_domain_policies/link_aggregation_policy/powershell/link_aggregation_policy.ps1 similarity index 100% rename from ucs_domain/link_aggregation_policy/powershell/link_aggregation_policy.ps1 rename to policies/ucs_domain_policies/link_aggregation_policy/powershell/link_aggregation_policy.ps1 diff --git a/ucs_domain/link_aggregation_policy/python/link_aggregation_policy.py b/policies/ucs_domain_policies/link_aggregation_policy/python/link_aggregation_policy.py similarity index 88% rename from ucs_domain/link_aggregation_policy/python/link_aggregation_policy.py rename to policies/ucs_domain_policies/link_aggregation_policy/python/link_aggregation_policy.py index 25ee3d1..e000e04 100644 --- a/ucs_domain/link_aggregation_policy/python/link_aggregation_policy.py +++ b/policies/ucs_domain_policies/link_aggregation_policy/python/link_aggregation_policy.py @@ -16,10 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_link_aggregation_policy(): api_instance = fabric_api.FabricApi(api_client) @@ -35,7 +35,7 @@ def create_link_aggregation_policy(): link_aggr_policy.description = "sample link aggregation policy." link_aggr_policy.organization = organization link_aggr_policy.lacp_rate = "normal" - + link_aggr_policy.suspend_individual = True # Example passing only required values which don't have defaults set try: diff --git a/policies/ucs_domain_policies/link_aggregation_policy/readme.md b/policies/ucs_domain_policies/link_aggregation_policy/readme.md new file mode 100644 index 0000000..5ad799b --- /dev/null +++ b/policies/ucs_domain_policies/link_aggregation_policy/readme.md @@ -0,0 +1,2 @@ +## Link Aggregation Policy +Enables to configure Link Aggregation properties. Link Aggregation combines multiple network connections in parallel to increase throughput and to provide redundancy. diff --git a/ucs_domain/link_aggregation_policy/terraform/link_aggregation_policy.tf b/policies/ucs_domain_policies/link_aggregation_policy/terraform/link_aggregation_policy.tf similarity index 100% rename from ucs_domain/link_aggregation_policy/terraform/link_aggregation_policy.tf rename to policies/ucs_domain_policies/link_aggregation_policy/terraform/link_aggregation_policy.tf diff --git a/ucs_domain/link_control_policy/ansible/link_control_policy.yaml b/policies/ucs_domain_policies/link_control_policy/ansible/link_control_policy.yaml similarity index 100% rename from ucs_domain/link_control_policy/ansible/link_control_policy.yaml rename to policies/ucs_domain_policies/link_control_policy/ansible/link_control_policy.yaml diff --git a/ucs_domain/link_control_policy/openapi/link_control_policy.json b/policies/ucs_domain_policies/link_control_policy/openapi/link_control_policy.json similarity index 100% rename from ucs_domain/link_control_policy/openapi/link_control_policy.json rename to policies/ucs_domain_policies/link_control_policy/openapi/link_control_policy.json diff --git a/ucs_domain/link_control_policy/powershell/link_control_policy.ps1 b/policies/ucs_domain_policies/link_control_policy/powershell/link_control_policy.ps1 similarity index 100% rename from ucs_domain/link_control_policy/powershell/link_control_policy.ps1 rename to policies/ucs_domain_policies/link_control_policy/powershell/link_control_policy.ps1 diff --git a/ucs_domain/link_control_policy/python/link_control_policy.py b/policies/ucs_domain_policies/link_control_policy/python/link_control_policy.py similarity index 91% rename from ucs_domain/link_control_policy/python/link_control_policy.py rename to policies/ucs_domain_policies/link_control_policy/python/link_control_policy.py index 0e241c0..eec6458 100644 --- a/ucs_domain/link_control_policy/python/link_control_policy.py +++ b/policies/ucs_domain_policies/link_control_policy/python/link_control_policy.py @@ -17,10 +17,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_link_control_policy(): api_instance = fabric_api.FabricApi(api_client) diff --git a/policies/ucs_domain_policies/link_control_policy/readme.md b/policies/ucs_domain_policies/link_control_policy/readme.md new file mode 100644 index 0000000..0a9af5a --- /dev/null +++ b/policies/ucs_domain_policies/link_control_policy/readme.md @@ -0,0 +1,2 @@ +## Link Control Policy +Enables configurations of Link Control administrative state and configuration (normal or aggressive) mode for ports. diff --git a/ucs_domain/link_control_policy/terraform/link_control_policy.tf b/policies/ucs_domain_policies/link_control_policy/terraform/link_control_policy.tf similarity index 100% rename from ucs_domain/link_control_policy/terraform/link_control_policy.tf rename to policies/ucs_domain_policies/link_control_policy/terraform/link_control_policy.tf diff --git a/ucs_domain/multicast_policy/ansible/multicast_policy.yaml b/policies/ucs_domain_policies/multicast_policy/ansible/multicast_policy.yaml similarity index 100% rename from ucs_domain/multicast_policy/ansible/multicast_policy.yaml rename to policies/ucs_domain_policies/multicast_policy/ansible/multicast_policy.yaml diff --git a/ucs_domain/multicast_policy/openapi/multicast_policy.json b/policies/ucs_domain_policies/multicast_policy/openapi/multicast_policy.json similarity index 100% rename from ucs_domain/multicast_policy/openapi/multicast_policy.json rename to policies/ucs_domain_policies/multicast_policy/openapi/multicast_policy.json diff --git a/ucs_domain/multicast_policy/powershell/multicast_policy.ps1 b/policies/ucs_domain_policies/multicast_policy/powershell/multicast_policy.ps1 similarity index 100% rename from ucs_domain/multicast_policy/powershell/multicast_policy.ps1 rename to policies/ucs_domain_policies/multicast_policy/powershell/multicast_policy.ps1 diff --git a/ucs_domain/multicast_policy/python/multicast_policy.py b/policies/ucs_domain_policies/multicast_policy/python/multicast_policy.py similarity index 90% rename from ucs_domain/multicast_policy/python/multicast_policy.py rename to policies/ucs_domain_policies/multicast_policy/python/multicast_policy.py index a015388..c86cd71 100644 --- a/ucs_domain/multicast_policy/python/multicast_policy.py +++ b/policies/ucs_domain_policies/multicast_policy/python/multicast_policy.py @@ -16,10 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_multicast_policy(): api_instance = fabric_api.FabricApi(api_client) diff --git a/policies/ucs_domain_policies/multicast_policy/readme.md b/policies/ucs_domain_policies/multicast_policy/readme.md new file mode 100644 index 0000000..7979272 --- /dev/null +++ b/policies/ucs_domain_policies/multicast_policy/readme.md @@ -0,0 +1,2 @@ +## Multicast Policy +Multicast policy is used to configure Internet Group Management Protocol (IGMP) snooping and IGMP querier. diff --git a/ucs_domain/multicast_policy/terraform/multicast_policy.tf b/policies/ucs_domain_policies/multicast_policy/terraform/multicast_policy.tf similarity index 100% rename from ucs_domain/multicast_policy/terraform/multicast_policy.tf rename to policies/ucs_domain_policies/multicast_policy/terraform/multicast_policy.tf diff --git a/ucs_domain/network_connectivity_policy/ansible/network_connectivity_policy.yaml b/policies/ucs_domain_policies/network_connectivity_policy/ansible/network_connectivity_policy.yaml similarity index 100% rename from ucs_domain/network_connectivity_policy/ansible/network_connectivity_policy.yaml rename to policies/ucs_domain_policies/network_connectivity_policy/ansible/network_connectivity_policy.yaml diff --git a/ucs_domain/network_connectivity_policy/openapi/network_connectivity_policy.json b/policies/ucs_domain_policies/network_connectivity_policy/openapi/network_connectivity_policy.json similarity index 100% rename from ucs_domain/network_connectivity_policy/openapi/network_connectivity_policy.json rename to policies/ucs_domain_policies/network_connectivity_policy/openapi/network_connectivity_policy.json diff --git a/ucs_domain/network_connectivity_policy/powershell/network_connectivity_policy.ps1 b/policies/ucs_domain_policies/network_connectivity_policy/powershell/network_connectivity_policy.ps1 similarity index 100% rename from ucs_domain/network_connectivity_policy/powershell/network_connectivity_policy.ps1 rename to policies/ucs_domain_policies/network_connectivity_policy/powershell/network_connectivity_policy.ps1 diff --git a/ucs_domain/network_connectivity_policy/python/network_connectivity_policy.py b/policies/ucs_domain_policies/network_connectivity_policy/python/network_connectivity_policy.py similarity index 85% rename from ucs_domain/network_connectivity_policy/python/network_connectivity_policy.py rename to policies/ucs_domain_policies/network_connectivity_policy/python/network_connectivity_policy.py index 8c74790..a1f824a 100644 --- a/ucs_domain/network_connectivity_policy/python/network_connectivity_policy.py +++ b/policies/ucs_domain_policies/network_connectivity_policy/python/network_connectivity_policy.py @@ -16,9 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_network_conn_policy(): @@ -36,6 +37,8 @@ def create_network_conn_policy(): nw_conn_policy.organization = organization nw_conn_policy.dynamic_dns_domain = "cisco.com" nw_conn_policy.preferred_ipv4dns_server = "8.8.8.8" + nw_conn_policy.alternate_ipv4dns_server = "22.22.22.22" + nw_conn_policy.enable_dynamic_dns =True nw_conn_policy.enable_ipv6 = True try: diff --git a/policies/ucs_domain_policies/network_connectivity_policy/readme.md b/policies/ucs_domain_policies/network_connectivity_policy/readme.md new file mode 100644 index 0000000..4945fa5 --- /dev/null +++ b/policies/ucs_domain_policies/network_connectivity_policy/readme.md @@ -0,0 +1,2 @@ +## Network Config Policy +Specifies the DNS Domain settings that are used to add or update the resource records on the DNS server from the endpoints, and the DNS server settings for IPv4 and IPv6 on an endpoint. diff --git a/ucs_domain/network_connectivity_policy/terraform/network_connectivity_policy.tf b/policies/ucs_domain_policies/network_connectivity_policy/terraform/network_connectivity_policy.tf similarity index 100% rename from ucs_domain/network_connectivity_policy/terraform/network_connectivity_policy.tf rename to policies/ucs_domain_policies/network_connectivity_policy/terraform/network_connectivity_policy.tf diff --git a/ucs_domain/network_control_policy/ansible/network_control_policy.yaml b/policies/ucs_domain_policies/network_control_policy/ansible/network_control_policy.yaml similarity index 100% rename from ucs_domain/network_control_policy/ansible/network_control_policy.yaml rename to policies/ucs_domain_policies/network_control_policy/ansible/network_control_policy.yaml diff --git a/ucs_domain/network_control_policy/openapi/network_control_policy.json b/policies/ucs_domain_policies/network_control_policy/openapi/network_control_policy.json similarity index 100% rename from ucs_domain/network_control_policy/openapi/network_control_policy.json rename to policies/ucs_domain_policies/network_control_policy/openapi/network_control_policy.json diff --git a/ucs_domain/network_control_policy/powershell/network_control_policy.ps1 b/policies/ucs_domain_policies/network_control_policy/powershell/network_control_policy.ps1 similarity index 100% rename from ucs_domain/network_control_policy/powershell/network_control_policy.ps1 rename to policies/ucs_domain_policies/network_control_policy/powershell/network_control_policy.ps1 diff --git a/ucs_domain/network_control_policy/python/network_control_policy.py b/policies/ucs_domain_policies/network_control_policy/python/network_control_policy.py similarity index 76% rename from ucs_domain/network_control_policy/python/network_control_policy.py rename to policies/ucs_domain_policies/network_control_policy/python/network_control_policy.py index 4f02331..bdd06b3 100644 --- a/ucs_domain/network_control_policy/python/network_control_policy.py +++ b/policies/ucs_domain_policies/network_control_policy/python/network_control_policy.py @@ -3,6 +3,7 @@ from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.fabric_eth_network_control_policy import FabricEthNetworkControlPolicy from intersight.model.fabric_lldp_settings import FabricLldpSettings +from intersight.model.vnic_eth_network_policy_relationship import VnicEthNetworkPolicyRelationship from intersight.api import fabric_api import intersight @@ -17,10 +18,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_eth_network_control_policy(): api_instance = fabric_api.FabricApi(api_client) @@ -29,6 +30,11 @@ def create_eth_network_control_policy(): organization = create_organization() lldp_settings = FabricLldpSettings(receive_enabled=False, transmit_enabled=False) + + # Craete an instance of network_policy + network_policy = VnicEthNetworkPolicyRelationship(class_id="mo.MoRef", + object_type="vnic.EthNetworkPolicy", + moid="moid_of_network_policy") # FabricEthNetworkControlPolicy | The 'fabric.EthNetworkControlPolicy' resource to create. eth_nw_ctrl_policy = FabricEthNetworkControlPolicy() @@ -39,8 +45,10 @@ def create_eth_network_control_policy(): eth_nw_ctrl_policy.organization = organization eth_nw_ctrl_policy.cdp_enabled = False eth_nw_ctrl_policy.mac_registration_mode = "allVlans" + eth_nw_ctrl_policy.forge_mac = "allow" eth_nw_ctrl_policy.uplink_fail_action = "linkDown" eth_nw_ctrl_policy.lldp_settings = lldp_settings + eth_nw_ctrl_policy.network_policy = [network_policy] # Example passing only required values which don't have defaults set diff --git a/policies/ucs_domain_policies/network_control_policy/readme.md b/policies/ucs_domain_policies/network_control_policy/readme.md new file mode 100644 index 0000000..5cffb21 --- /dev/null +++ b/policies/ucs_domain_policies/network_control_policy/readme.md @@ -0,0 +1,3 @@ +## Network Control Policy +Configures the network control settings for the appliance ports, appliance port channels, or vNICs. + diff --git a/ucs_domain/network_control_policy/terraform/network_control_policy.tf b/policies/ucs_domain_policies/network_control_policy/terraform/network_control_policy.tf similarity index 100% rename from ucs_domain/network_control_policy/terraform/network_control_policy.tf rename to policies/ucs_domain_policies/network_control_policy/terraform/network_control_policy.tf diff --git a/ucs_domain/network_group_policy/ansible/network_group_policy.yaml b/policies/ucs_domain_policies/network_group_policy/ansible/network_group_policy.yaml similarity index 100% rename from ucs_domain/network_group_policy/ansible/network_group_policy.yaml rename to policies/ucs_domain_policies/network_group_policy/ansible/network_group_policy.yaml diff --git a/ucs_domain/network_group_policy/openapi/network_group_policy.json b/policies/ucs_domain_policies/network_group_policy/openapi/network_group_policy.json similarity index 100% rename from ucs_domain/network_group_policy/openapi/network_group_policy.json rename to policies/ucs_domain_policies/network_group_policy/openapi/network_group_policy.json diff --git a/ucs_domain/network_group_policy/powershell/network_group_policy.ps1 b/policies/ucs_domain_policies/network_group_policy/powershell/network_group_policy.ps1 similarity index 100% rename from ucs_domain/network_group_policy/powershell/network_group_policy.ps1 rename to policies/ucs_domain_policies/network_group_policy/powershell/network_group_policy.ps1 diff --git a/ucs_domain/network_group_policy/python/network_group_policy.py b/policies/ucs_domain_policies/network_group_policy/python/network_group_policy.py similarity index 91% rename from ucs_domain/network_group_policy/python/network_group_policy.py rename to policies/ucs_domain_policies/network_group_policy/python/network_group_policy.py index 7c21859..fd340d6 100644 --- a/ucs_domain/network_group_policy/python/network_group_policy.py +++ b/policies/ucs_domain_policies/network_group_policy/python/network_group_policy.py @@ -17,9 +17,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_eth_network_group_policy(): diff --git a/policies/ucs_domain_policies/network_group_policy/readme.md b/policies/ucs_domain_policies/network_group_policy/readme.md new file mode 100644 index 0000000..aa4a4b0 --- /dev/null +++ b/policies/ucs_domain_policies/network_group_policy/readme.md @@ -0,0 +1,2 @@ +## Network Group Policy +Configures the allowed VLAN and native VLAN for the appliance ports, appliance port channels, or vNICs. diff --git a/ucs_domain/network_group_policy/terraform/network_group_policy.tf b/policies/ucs_domain_policies/network_group_policy/terraform/network_group_policy.tf similarity index 100% rename from ucs_domain/network_group_policy/terraform/network_group_policy.tf rename to policies/ucs_domain_policies/network_group_policy/terraform/network_group_policy.tf diff --git a/ucs_domain/ntp_policy/ansible/ntp_policy.yaml b/policies/ucs_domain_policies/ntp_policy/ansible/ntp_policy.yaml similarity index 100% rename from ucs_domain/ntp_policy/ansible/ntp_policy.yaml rename to policies/ucs_domain_policies/ntp_policy/ansible/ntp_policy.yaml diff --git a/ucs_domain/ntp_policy/openapi/ntp_policy.json b/policies/ucs_domain_policies/ntp_policy/openapi/ntp_policy.json similarity index 100% rename from ucs_domain/ntp_policy/openapi/ntp_policy.json rename to policies/ucs_domain_policies/ntp_policy/openapi/ntp_policy.json diff --git a/ucs_domain/ntp_policy/powershell/ntp_policy.ps1 b/policies/ucs_domain_policies/ntp_policy/powershell/ntp_policy.ps1 similarity index 100% rename from ucs_domain/ntp_policy/powershell/ntp_policy.ps1 rename to policies/ucs_domain_policies/ntp_policy/powershell/ntp_policy.ps1 diff --git a/ucs_domain/ntp_policy/python/ntp_policy.py b/policies/ucs_domain_policies/ntp_policy/python/ntp_policy.py similarity index 88% rename from ucs_domain/ntp_policy/python/ntp_policy.py rename to policies/ucs_domain_policies/ntp_policy/python/ntp_policy.py index 61c4542..0746266 100644 --- a/ucs_domain/ntp_policy/python/ntp_policy.py +++ b/policies/ucs_domain_policies/ntp_policy/python/ntp_policy.py @@ -16,9 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_ntp_policy(): @@ -36,6 +37,7 @@ def create_ntp_policy(): # Setting all the attributes for ntp_policy instance. ntp_policy.name = "sample_ntp_policy1" ntp_policy.description = "sample ntp policy." + ntp_policy.enabled = True ntp_policy.organization = organization ntp_policy.ntp_servers = ntp_servers diff --git a/policies/ucs_domain_policies/ntp_policy/readme.md b/policies/ucs_domain_policies/ntp_policy/readme.md new file mode 100644 index 0000000..c2567b9 --- /dev/null +++ b/policies/ucs_domain_policies/ntp_policy/readme.md @@ -0,0 +1,2 @@ +## NTP Policy +Allows you to enable the NTP service on an Intersight Managed Cisco IMC (Standalone) server. The NTP service synchronizes the time with an NTP server. You must enable and configure the NTP service by specifying the IP address or DNS of a minimum of one to a maximum of four NTP servers. diff --git a/ucs_domain/ntp_policy/terraform/ntp_policy.tf b/policies/ucs_domain_policies/ntp_policy/terraform/ntp_policy.tf similarity index 100% rename from ucs_domain/ntp_policy/terraform/ntp_policy.tf rename to policies/ucs_domain_policies/ntp_policy/terraform/ntp_policy.tf diff --git a/ucs_domain/port_policy/ansible/port_policy.yaml b/policies/ucs_domain_policies/port_policy/ansible/port_policy.yaml similarity index 100% rename from ucs_domain/port_policy/ansible/port_policy.yaml rename to policies/ucs_domain_policies/port_policy/ansible/port_policy.yaml diff --git a/ucs_domain/port_policy/openapi/port_policy.json b/policies/ucs_domain_policies/port_policy/openapi/port_policy.json similarity index 100% rename from ucs_domain/port_policy/openapi/port_policy.json rename to policies/ucs_domain_policies/port_policy/openapi/port_policy.json diff --git a/ucs_domain/port_policy/powershell/port_policy.ps1 b/policies/ucs_domain_policies/port_policy/powershell/port_policy.ps1 similarity index 100% rename from ucs_domain/port_policy/powershell/port_policy.ps1 rename to policies/ucs_domain_policies/port_policy/powershell/port_policy.ps1 diff --git a/ucs_domain/port_policy/python/port_policy.py b/policies/ucs_domain_policies/port_policy/python/port_policy.py similarity index 89% rename from ucs_domain/port_policy/python/port_policy.py rename to policies/ucs_domain_policies/port_policy/python/port_policy.py index 84bcd9a..60056d1 100644 --- a/ucs_domain/port_policy/python/port_policy.py +++ b/policies/ucs_domain_policies/port_policy/python/port_policy.py @@ -16,9 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_port_policy(): diff --git a/ucs_domain/port_policy/readme.md b/policies/ucs_domain_policies/port_policy/readme.md similarity index 51% rename from ucs_domain/port_policy/readme.md rename to policies/ucs_domain_policies/port_policy/readme.md index f371ead..257af3f 100644 --- a/ucs_domain/port_policy/readme.md +++ b/policies/ucs_domain_policies/port_policy/readme.md @@ -14,10 +14,3 @@ The maximum number of ports and port channels supported are: Ethernet Uplink and FCoE Uplink ports (combined)—31 Server ports—54 ports for Cisco UCS 6454 and 108 ports for Cisco UCS 64108 Fabric Interconnects - -## Port Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Port Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/port_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Port Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/port_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Port Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightPortPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/port_policy/terraform/port_policy.tf b/policies/ucs_domain_policies/port_policy/terraform/port_policy.tf similarity index 100% rename from ucs_domain/port_policy/terraform/port_policy.tf rename to policies/ucs_domain_policies/port_policy/terraform/port_policy.tf diff --git a/ucs_domain/snmp_policy/ansible/snmp_policy.yaml b/policies/ucs_domain_policies/snmp_policy/ansible/snmp_policy.yaml similarity index 100% rename from ucs_domain/snmp_policy/ansible/snmp_policy.yaml rename to policies/ucs_domain_policies/snmp_policy/ansible/snmp_policy.yaml diff --git a/ucs_domain/snmp_policy/openapi/snmp_policy.json b/policies/ucs_domain_policies/snmp_policy/openapi/snmp_policy.json similarity index 100% rename from ucs_domain/snmp_policy/openapi/snmp_policy.json rename to policies/ucs_domain_policies/snmp_policy/openapi/snmp_policy.json diff --git a/ucs_domain/snmp_policy/powershell/snmp_policy.ps1 b/policies/ucs_domain_policies/snmp_policy/powershell/snmp_policy.ps1 similarity index 100% rename from ucs_domain/snmp_policy/powershell/snmp_policy.ps1 rename to policies/ucs_domain_policies/snmp_policy/powershell/snmp_policy.ps1 diff --git a/ucs_server/management/snmp_policy/python/snmp_policy.py b/policies/ucs_domain_policies/snmp_policy/python/snmp_policy.py similarity index 75% rename from ucs_server/management/snmp_policy/python/snmp_policy.py rename to policies/ucs_domain_policies/snmp_policy/python/snmp_policy.py index f0289c8..2a109fd 100644 --- a/ucs_server/management/snmp_policy/python/snmp_policy.py +++ b/policies/ucs_domain_policies/snmp_policy/python/snmp_policy.py @@ -3,6 +3,7 @@ from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.snmp_policy import SnmpPolicy from intersight.model.snmp_user import SnmpUser +from intersight.model.snmp_trap import SnmpTrap from intersight.api import snmp_api import intersight @@ -17,16 +18,16 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_snmp_policy(): # Create an instance of the API class api_instance = snmp_api.SnmpApi(api_client) - # Create an instance of organization and snmp user. + # Create an instance of organization, snmp user and snmp trap. organization = create_organization() snmp_user = SnmpUser(class_id="snmp.User", object_type="snmp.User", @@ -36,6 +37,12 @@ def create_snmp_policy(): name="user1", auth_password="Auth_Snmp_user1", privacy_password="Priv_Snmp_user1") + snmp_trap = SnmpTrap(community="trapCommString", + destination="11.11.11.11", + enabled=True, + port=162, + type="Trap", + version="V2") # SnmpPolicy | The 'snmp.Policy' resource to create. snmp_policy = SnmpPolicy() @@ -44,12 +51,15 @@ def create_snmp_policy(): snmp_policy.name = "sample_snmp_policy1" snmp_policy.description = "sample snmp policy." snmp_policy.enabled = True + snmp_policy.access_community_string = "acc_comm_string" + snmp_policy.community_access = "Disabled" snmp_policy.sys_location = "BLR" snmp_policy.trap_community = "snmpv3" snmp_policy.engine_id = "12121" snmp_policy.snmp_port = 161 snmp_policy.sys_contact = "DA" snmp_policy.snmp_users = [snmp_user] + snmp_policy.snmp_traps = [snmp_trap] snmp_policy.organization = organization # Example passing only required values which don't have defaults set diff --git a/policies/ucs_domain_policies/snmp_policy/readme.md b/policies/ucs_domain_policies/snmp_policy/readme.md new file mode 100644 index 0000000..d59162e --- /dev/null +++ b/policies/ucs_domain_policies/snmp_policy/readme.md @@ -0,0 +1,2 @@ +## SNMP POlicy +Configures the SNMP settings for sending fault and alert information by SNMP traps from the managed devices. Any existing SNMP Users or SNMP Traps configured previously on the managed devices are removed and replaced with users or traps that you configure in this policy. diff --git a/ucs_domain/snmp_policy/terraform/snmp_policy.tf b/policies/ucs_domain_policies/snmp_policy/terraform/snmp_policy.tf similarity index 100% rename from ucs_domain/snmp_policy/terraform/snmp_policy.tf rename to policies/ucs_domain_policies/snmp_policy/terraform/snmp_policy.tf diff --git a/ucs_domain/switch_control_policy/ansible/switch_control_policy.yaml b/policies/ucs_domain_policies/switch_control_policy/ansible/switch_control_policy.yaml similarity index 100% rename from ucs_domain/switch_control_policy/ansible/switch_control_policy.yaml rename to policies/ucs_domain_policies/switch_control_policy/ansible/switch_control_policy.yaml diff --git a/ucs_domain/switch_control_policy/openapi/switch_control_policy.json b/policies/ucs_domain_policies/switch_control_policy/openapi/switch_control_policy.json similarity index 100% rename from ucs_domain/switch_control_policy/openapi/switch_control_policy.json rename to policies/ucs_domain_policies/switch_control_policy/openapi/switch_control_policy.json diff --git a/ucs_domain/switch_control_policy/powershell/switch_control_policy.ps1 b/policies/ucs_domain_policies/switch_control_policy/powershell/switch_control_policy.ps1 similarity index 100% rename from ucs_domain/switch_control_policy/powershell/switch_control_policy.ps1 rename to policies/ucs_domain_policies/switch_control_policy/powershell/switch_control_policy.ps1 diff --git a/ucs_domain/switch_control_policy/python/switch_control_policy.py b/policies/ucs_domain_policies/switch_control_policy/python/switch_control_policy.py similarity index 69% rename from ucs_domain/switch_control_policy/python/switch_control_policy.py rename to policies/ucs_domain_policies/switch_control_policy/python/switch_control_policy.py index 30e7212..d952fb5 100644 --- a/ucs_domain/switch_control_policy/python/switch_control_policy.py +++ b/policies/ucs_domain_policies/switch_control_policy/python/switch_control_policy.py @@ -2,6 +2,8 @@ from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.fabric_switch_control_policy import FabricSwitchControlPolicy +from intersight.model.fabric_udld_global_settings import FabricUdldGlobalSettings +from intersight.model.fabric_mac_aging_settings import FabricMacAgingSettings from intersight.api import fabric_api import intersight @@ -16,9 +18,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_switch_control_policy(): @@ -26,6 +29,12 @@ def create_switch_control_policy(): # Create an instance of organization. organization = create_organization() + # Create an instance of FabricMacAgingSettings + mac_aging_settings = FabricMacAgingSettings(mac_aging_option="Default", + mac_aging_time=14500) + # Create an instance of FabricUdldGlobalSettings + udld_settings = FabricUdldGlobalSettings(recovery_action="none", + message_interval=12) # FabricSwitchControlPolicy | The 'fabric.SwitchControlPolicy' resource to create. switch_control_policy = FabricSwitchControlPolicy() @@ -36,6 +45,8 @@ def create_switch_control_policy(): switch_control_policy.organization = organization switch_control_policy.ethernet_switching_mode = "end-host" switch_control_policy.fc_switching_mode = "end-host" + switch_control_policy.udld_settings=udld_settings + switch_control_policy.mac_aging_settings=mac_aging_settings # Example passing only required values which don't have defaults set try: diff --git a/policies/ucs_domain_policies/switch_control_policy/readme.md b/policies/ucs_domain_policies/switch_control_policy/readme.md new file mode 100644 index 0000000..c7a3d7c --- /dev/null +++ b/policies/ucs_domain_policies/switch_control_policy/readme.md @@ -0,0 +1,8 @@ +## Switch Control Policy +Enables to configure and manage multiple network operations on the Fabric Interconnects (FI) that include: + +- Port Count Optimization—If the VLAN port count optimization is enabled, the Virtual Port (VP) groups are configured on the Fabric Interconnect (FI) and if VLAN port count optimization is disabled, the configured VP groups are removed from the FI. + +- MAC Aging Time—Allows to set the MAC aging time for the MAC address table entries. The MAC aging time specifies the time before a MAC entry expires and discards the entry from the MAC address table. + +- Link Control Global Settings—Enables configurations of message interval time in seconds and allows to reset the recovery action of an error-disabled port. diff --git a/ucs_domain/switch_control_policy/terraform/switch_control_policy.tf b/policies/ucs_domain_policies/switch_control_policy/terraform/switch_control_policy.tf similarity index 100% rename from ucs_domain/switch_control_policy/terraform/switch_control_policy.tf rename to policies/ucs_domain_policies/switch_control_policy/terraform/switch_control_policy.tf diff --git a/ucs_domain/syslog_policy/ansible/syslog_policy.yaml b/policies/ucs_domain_policies/syslog_policy/ansible/syslog_policy.yaml similarity index 100% rename from ucs_domain/syslog_policy/ansible/syslog_policy.yaml rename to policies/ucs_domain_policies/syslog_policy/ansible/syslog_policy.yaml diff --git a/ucs_domain/syslog_policy/openapi/syslog_policy.json b/policies/ucs_domain_policies/syslog_policy/openapi/syslog_policy.json similarity index 100% rename from ucs_domain/syslog_policy/openapi/syslog_policy.json rename to policies/ucs_domain_policies/syslog_policy/openapi/syslog_policy.json diff --git a/ucs_domain/syslog_policy/powershell/syslog_policy.ps1 b/policies/ucs_domain_policies/syslog_policy/powershell/syslog_policy.ps1 similarity index 100% rename from ucs_domain/syslog_policy/powershell/syslog_policy.ps1 rename to policies/ucs_domain_policies/syslog_policy/powershell/syslog_policy.ps1 diff --git a/ucs_domain/syslog_policy/python/syslog_policy.py b/policies/ucs_domain_policies/syslog_policy/python/syslog_policy.py similarity index 68% rename from ucs_domain/syslog_policy/python/syslog_policy.py rename to policies/ucs_domain_policies/syslog_policy/python/syslog_policy.py index f1a07b1..6e0775d 100644 --- a/ucs_domain/syslog_policy/python/syslog_policy.py +++ b/policies/ucs_domain_policies/syslog_policy/python/syslog_policy.py @@ -3,6 +3,7 @@ from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.syslog_policy import SyslogPolicy from intersight.model.syslog_local_client_base import SyslogLocalClientBase +from intersight.model.syslog_remote_client_base import SyslogRemoteClientBase from intersight.api import syslog_api import intersight @@ -17,19 +18,27 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_syslog_policy(): api_instance = syslog_api.SyslogApi(api_client) - # Create an instance of organization and syslog client. + # Create an instance of organization, syslog client and remote_client. organization = create_organization() syslog_client = SyslogLocalClientBase(class_id="syslog.LocalFileLoggingClient", object_type="syslog.LocalFileLoggingClient", min_severity="warning") + remote_client = SyslogRemoteClientBase(class_id="syslog.RemoteLoggingClient", + object_type="syslog.RemoteLoggingClient", + enabled=True, + hostname="11.11.11.11", + min_severity="warning", + port=514, + protocol="udp") # SyslogPolicy | The 'syslog.Policy' resource to create. syslog_policy = SyslogPolicy() @@ -39,6 +48,7 @@ def create_syslog_policy(): syslog_policy.description = "sample syslog policy." syslog_policy.organization = organization syslog_policy.local_clients = [syslog_client] + syslog_policy.remote_clients = [remote_client] # Example passing only required values which don't have defaults set diff --git a/policies/ucs_domain_policies/syslog_policy/readme.md b/policies/ucs_domain_policies/syslog_policy/readme.md new file mode 100644 index 0000000..5ca053a --- /dev/null +++ b/policies/ucs_domain_policies/syslog_policy/readme.md @@ -0,0 +1,3 @@ + +## Syslog Policy +Enables to configure the local logging and remote logging (minimum severity) for an endpoint. This policy also provides configuration support to store the syslog messages in the local file and the remote syslog server. diff --git a/ucs_domain/syslog_policy/terraform/syslog_policy.tf b/policies/ucs_domain_policies/syslog_policy/terraform/syslog_policy.tf similarity index 100% rename from ucs_domain/syslog_policy/terraform/syslog_policy.tf rename to policies/ucs_domain_policies/syslog_policy/terraform/syslog_policy.tf diff --git a/ucs_domain/system_qos_policy/ansible/system_qos_policy.yaml b/policies/ucs_domain_policies/system_qos_policy/ansible/system_qos_policy.yaml similarity index 100% rename from ucs_domain/system_qos_policy/ansible/system_qos_policy.yaml rename to policies/ucs_domain_policies/system_qos_policy/ansible/system_qos_policy.yaml diff --git a/ucs_domain/system_qos_policy/openapi/system_qos_policy.json b/policies/ucs_domain_policies/system_qos_policy/openapi/system_qos_policy.json similarity index 100% rename from ucs_domain/system_qos_policy/openapi/system_qos_policy.json rename to policies/ucs_domain_policies/system_qos_policy/openapi/system_qos_policy.json diff --git a/ucs_domain/system_qos_policy/powershell/system_qos_policy.ps1 b/policies/ucs_domain_policies/system_qos_policy/powershell/system_qos_policy.ps1 similarity index 100% rename from ucs_domain/system_qos_policy/powershell/system_qos_policy.ps1 rename to policies/ucs_domain_policies/system_qos_policy/powershell/system_qos_policy.ps1 diff --git a/ucs_domain/system_qos_policy/python/system_qos_policy.py b/policies/ucs_domain_policies/system_qos_policy/python/system_qos_policy.py similarity index 91% rename from ucs_domain/system_qos_policy/python/system_qos_policy.py rename to policies/ucs_domain_policies/system_qos_policy/python/system_qos_policy.py index b843c0a..e31d0f2 100644 --- a/ucs_domain/system_qos_policy/python/system_qos_policy.py +++ b/policies/ucs_domain_policies/system_qos_policy/python/system_qos_policy.py @@ -17,9 +17,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_system_qos_policy(): diff --git a/ucs_domain/system_qos_policy/readme.md b/policies/ucs_domain_policies/system_qos_policy/readme.md similarity index 73% rename from ucs_domain/system_qos_policy/readme.md rename to policies/ucs_domain_policies/system_qos_policy/readme.md index d0ac6c0..7fc1f53 100644 --- a/ucs_domain/system_qos_policy/readme.md +++ b/policies/ucs_domain_policies/system_qos_policy/readme.md @@ -12,12 +12,3 @@ The following list describes the system classes that you can configure. - Best Effort—A system class that sets the quality of service for the lane reserved for basic Ethernet traffic. Some properties of this system class are preset and cannot be modified. For example, this class has a drop policy that allows it to drop data packets if required. You cannot disable this system class. - Fibre Channel—A system class that sets the quality of service for the lane reserved for Fibre Channel over Ethernet traffic. Some properties of this system class are preset and cannot be modified. For example, this class has a no-drop policy that ensures it never drops data packets. You cannot disable this system class. - - -## System Qos Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [System Qos Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_system_qos_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [System Qos Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_system_qos_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [System Qos Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricSystemQosPolicy.md) properties reference - diff --git a/ucs_domain/system_qos_policy/terraform/system_qos_policy.tf b/policies/ucs_domain_policies/system_qos_policy/terraform/system_qos_policy.tf similarity index 100% rename from ucs_domain/system_qos_policy/terraform/system_qos_policy.tf rename to policies/ucs_domain_policies/system_qos_policy/terraform/system_qos_policy.tf diff --git a/ucs_domain/vlan_configuration_policy/ansible/vlan_configuration_policy.yaml b/policies/ucs_domain_policies/vlan_configuration_policy/ansible/vlan_configuration_policy.yaml similarity index 100% rename from ucs_domain/vlan_configuration_policy/ansible/vlan_configuration_policy.yaml rename to policies/ucs_domain_policies/vlan_configuration_policy/ansible/vlan_configuration_policy.yaml diff --git a/ucs_domain/vlan_configuration_policy/openapi/vlan_configuration_policy.json b/policies/ucs_domain_policies/vlan_configuration_policy/openapi/vlan_configuration_policy.json similarity index 100% rename from ucs_domain/vlan_configuration_policy/openapi/vlan_configuration_policy.json rename to policies/ucs_domain_policies/vlan_configuration_policy/openapi/vlan_configuration_policy.json diff --git a/ucs_domain/vlan_configuration_policy/powershell/vlan_configuration_policy.ps1 b/policies/ucs_domain_policies/vlan_configuration_policy/powershell/vlan_configuration_policy.ps1 similarity index 100% rename from ucs_domain/vlan_configuration_policy/powershell/vlan_configuration_policy.ps1 rename to policies/ucs_domain_policies/vlan_configuration_policy/powershell/vlan_configuration_policy.ps1 diff --git a/ucs_domain/vlan_configuration_policy/python/vlan_configuration_policy.py b/policies/ucs_domain_policies/vlan_configuration_policy/python/vlan_configuration_policy.py similarity index 94% rename from ucs_domain/vlan_configuration_policy/python/vlan_configuration_policy.py rename to policies/ucs_domain_policies/vlan_configuration_policy/python/vlan_configuration_policy.py index 477bedf..5a8f1d2 100644 --- a/ucs_domain/vlan_configuration_policy/python/vlan_configuration_policy.py +++ b/policies/ucs_domain_policies/vlan_configuration_policy/python/vlan_configuration_policy.py @@ -20,9 +20,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_network_policy_reference(network_policy_moid): @@ -105,6 +106,9 @@ def create_vlan(network_policy_moid, multicast_policy_moid): vlan.vlan_id = 2222 vlan.eth_network_policy = create_network_policy_reference(network_policy_moid) vlan.multicast_policy = create_multicast_policy_reference(multicast_policy_moid) + vlan.auto_allow_on_uplinks = False + vlan.is_native = False + vlan.vlan_id = 23 try: # Create a 'fabric.Vlan' resource. diff --git a/policies/ucs_domain_policies/vlan_configuration_policy/readme.md b/policies/ucs_domain_policies/vlan_configuration_policy/readme.md new file mode 100644 index 0000000..9b40d73 --- /dev/null +++ b/policies/ucs_domain_policies/vlan_configuration_policy/readme.md @@ -0,0 +1,3 @@ +## VLAN Configuration Policy +Creates a connection to a specific external LAN. + diff --git a/ucs_domain/vlan_configuration_policy/terraform/vlan_configuration_policy.tf b/policies/ucs_domain_policies/vlan_configuration_policy/terraform/vlan_configuration_policy.tf similarity index 100% rename from ucs_domain/vlan_configuration_policy/terraform/vlan_configuration_policy.tf rename to policies/ucs_domain_policies/vlan_configuration_policy/terraform/vlan_configuration_policy.tf diff --git a/ucs_domain/vsan_configuration_policy/ansible/vsan_configuration_policy.yaml b/policies/ucs_domain_policies/vsan_configuration_policy/ansible/vsan_configuration_policy.yaml similarity index 100% rename from ucs_domain/vsan_configuration_policy/ansible/vsan_configuration_policy.yaml rename to policies/ucs_domain_policies/vsan_configuration_policy/ansible/vsan_configuration_policy.yaml diff --git a/ucs_domain/vsan_configuration_policy/openapi/vsan_configuration_policy.json b/policies/ucs_domain_policies/vsan_configuration_policy/openapi/vsan_configuration_policy.json similarity index 100% rename from ucs_domain/vsan_configuration_policy/openapi/vsan_configuration_policy.json rename to policies/ucs_domain_policies/vsan_configuration_policy/openapi/vsan_configuration_policy.json diff --git a/ucs_domain/vsan_configuration_policy/powershell/vsan_configuration_policy.ps1 b/policies/ucs_domain_policies/vsan_configuration_policy/powershell/vsan_configuration_policy.ps1 similarity index 100% rename from ucs_domain/vsan_configuration_policy/powershell/vsan_configuration_policy.ps1 rename to policies/ucs_domain_policies/vsan_configuration_policy/powershell/vsan_configuration_policy.ps1 diff --git a/ucs_domain/vsan_configuration_policy/python/vsan_configuration_policy.py b/policies/ucs_domain_policies/vsan_configuration_policy/python/vsan_configuration_policy.py similarity index 93% rename from ucs_domain/vsan_configuration_policy/python/vsan_configuration_policy.py rename to policies/ucs_domain_policies/vsan_configuration_policy/python/vsan_configuration_policy.py index c40ffe5..04731b8 100644 --- a/ucs_domain/vsan_configuration_policy/python/vsan_configuration_policy.py +++ b/policies/ucs_domain_policies/vsan_configuration_policy/python/vsan_configuration_policy.py @@ -18,9 +18,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_vsan_policy_reference(vsan_policy_moid): return FabricFcNetworkPolicyRelationship(class_id="mo.MoRef", diff --git a/policies/ucs_domain_policies/vsan_configuration_policy/readme.md b/policies/ucs_domain_policies/vsan_configuration_policy/readme.md new file mode 100644 index 0000000..c12c9ea --- /dev/null +++ b/policies/ucs_domain_policies/vsan_configuration_policy/readme.md @@ -0,0 +1,2 @@ +## VSAN Configuration Policy +Partitions the Fibre Channel fabric into one or more zones. Each zone defines the set of Fibre Channel initiators and Fibre Channel targets that can communicate with each other in a VSAN. diff --git a/ucs_domain/vsan_configuration_policy/terraform/vsan_configuration_policy.tf b/policies/ucs_domain_policies/vsan_configuration_policy/terraform/vsan_configuration_policy.tf similarity index 100% rename from ucs_domain/vsan_configuration_policy/terraform/vsan_configuration_policy.tf rename to policies/ucs_domain_policies/vsan_configuration_policy/terraform/vsan_configuration_policy.tf diff --git a/ucs_server/compute/bios_policy/ansible/bios_policy.yaml b/policies/ucs_server_policies/compute/bios_policy/ansible/bios_policy.yaml similarity index 100% rename from ucs_server/compute/bios_policy/ansible/bios_policy.yaml rename to policies/ucs_server_policies/compute/bios_policy/ansible/bios_policy.yaml diff --git a/ucs_server/compute/bios_policy/openapi/bios_policy.json b/policies/ucs_server_policies/compute/bios_policy/openapi/bios_policy.json similarity index 100% rename from ucs_server/compute/bios_policy/openapi/bios_policy.json rename to policies/ucs_server_policies/compute/bios_policy/openapi/bios_policy.json diff --git a/ucs_server/compute/bios_policy/powershell/bios_policy.ps1 b/policies/ucs_server_policies/compute/bios_policy/powershell/bios_policy.ps1 similarity index 100% rename from ucs_server/compute/bios_policy/powershell/bios_policy.ps1 rename to policies/ucs_server_policies/compute/bios_policy/powershell/bios_policy.ps1 diff --git a/ucs_server/compute/bios_policy/python/bios_policy.py b/policies/ucs_server_policies/compute/bios_policy/python/bios_policy.py similarity index 79% rename from ucs_server/compute/bios_policy/python/bios_policy.py rename to policies/ucs_server_policies/compute/bios_policy/python/bios_policy.py index 3d4bd3d..2ad149b 100644 --- a/ucs_server/compute/bios_policy/python/bios_policy.py +++ b/policies/ucs_server_policies/compute/bios_policy/python/bios_policy.py @@ -16,9 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_bios_policy(): @@ -40,6 +41,11 @@ def create_bios_policy(): bios_policy.boot_option_retry = "enabled" bios_policy.core_multi_processing = "4" bios_policy.cpu_power_management = "energy-efficient" + bios_policy.intel_hyper_threading_tech = "enabled" + bios_policy.intel_turbo_boost_tech = "enabled" + bios_policy.enhanced_intel_speed_step_tech = "enabled" + bios_policy.hardware_prefetch = "enabled" + bios_policy.energy_efficient_turbo = "disabled" try: # Create a 'bios.Policy' resource. diff --git a/policies/ucs_server_policies/compute/bios_policy/readme.md b/policies/ucs_server_policies/compute/bios_policy/readme.md new file mode 100644 index 0000000..3ee4857 --- /dev/null +++ b/policies/ucs_server_policies/compute/bios_policy/readme.md @@ -0,0 +1,2 @@ +## BIOS Policy +A BIOS policy automates the configuration of BIOS settings on servers. You can create one or more BIOS policies that contain a specific grouping of BIOS settings, matching the needs of a server or a set of servers. If you do not specify a BIOS policy for a server, the BIOS settings will default to set of values for a brand new baremetal server or to a set of values previously configured using Cisco IMC. If a BIOS policy is specified, its values replace any previously configured values on the server. diff --git a/ucs_server/compute/bios_policy/terraform/bios_policy.tf b/policies/ucs_server_policies/compute/bios_policy/terraform/bios_policy.tf similarity index 100% rename from ucs_server/compute/bios_policy/terraform/bios_policy.tf rename to policies/ucs_server_policies/compute/bios_policy/terraform/bios_policy.tf diff --git a/ucs_server/compute/boot_order_policy/ansible/boot_order_policy.yaml b/policies/ucs_server_policies/compute/boot_order_policy/ansible/boot_order_policy.yaml similarity index 100% rename from ucs_server/compute/boot_order_policy/ansible/boot_order_policy.yaml rename to policies/ucs_server_policies/compute/boot_order_policy/ansible/boot_order_policy.yaml diff --git a/ucs_server/compute/boot_order_policy/openapi/boot_order_policy.json b/policies/ucs_server_policies/compute/boot_order_policy/openapi/boot_order_policy.json similarity index 100% rename from ucs_server/compute/boot_order_policy/openapi/boot_order_policy.json rename to policies/ucs_server_policies/compute/boot_order_policy/openapi/boot_order_policy.json diff --git a/ucs_server/compute/boot_order_policy/powershell/boot_order_policy.ps1 b/policies/ucs_server_policies/compute/boot_order_policy/powershell/boot_order_policy.ps1 similarity index 100% rename from ucs_server/compute/boot_order_policy/powershell/boot_order_policy.ps1 rename to policies/ucs_server_policies/compute/boot_order_policy/powershell/boot_order_policy.ps1 diff --git a/policies/ucs_server_policies/compute/boot_order_policy/python/boot_order_policy.py b/policies/ucs_server_policies/compute/boot_order_policy/python/boot_order_policy.py new file mode 100644 index 0000000..930b947 --- /dev/null +++ b/policies/ucs_server_policies/compute/boot_order_policy/python/boot_order_policy.py @@ -0,0 +1,149 @@ +from authentication.python import intersight_authentication as client + +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.boot_precision_policy import BootPrecisionPolicy +from intersight.model.boot_device_base import BootDeviceBase +from intersight.model.boot_virtual_media import BootVirtualMedia +from intersight.model.boot_usb import BootUsb +from intersight.model.boot_uefi_shell import BootUefiShell +from intersight.model.boot_pxe import BootPxe +from intersight.model.boot_san import BootSan +from intersight.model.boot_bootloader import BootBootloader +from intersight.api import boot_api +import intersight + +from pprint import pprint +import sys + + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + + +def create_boot_local_cdd(): + # Creating an instance of boot_local_cdd + boot_local_cdd = BootDeviceBase(class_id="boot.LocalCdd", + object_type="boot.LocalCdd", + name="local_cdd1", + enabled=True) + return boot_local_cdd + + +def create_boot_local_disk(): + # Creating an instance of boot_local_disk + boot_local_disk = BootDeviceBase(class_id="boot.LocalDisk", + object_type="boot.LocalDisk", + name="local_disk1", + enabled=True) + return boot_local_disk + +def create_boot_vmedia(): + # Creating instance of boot_virtual_media + boot_vmedia = BootVirtualMedia(class_id="boot.VirtualMedia", + object_type="boot.VirtualMedia", + name="vmedia1", + subtype="cimc-mapped-hdd", + enabled=True) + return boot_vmedia + +def create_boot_usb(): + # Creating instance of boot_usb + boot_usb = BootUsb(class_id="boot.Usb", + object_type="boot.Usb", + name="usb1", + subtype="usb-fdd", + enabled=True) + return boot_usb + +def create_boot_uefi(): + # Creating instance of boot_uefi_shell + boot_uefi = BootUefiShell(class_id="boot.UefiShell", + object_type="boot.UefiShell", + name="uefi1", + enabled=True) + return boot_uefi + +def create_boot_pxe(): + # Creating instance of boot_pxe + boot_pxe = BootPxe(class_id="boot.Pxe", + object_type="boot.Pxe", + name="pxe1", + interface_name="eth0", + ip_type="IPv4", + enabled=True) + return boot_pxe + +def create_bootloader(): + # Creating instance of boot_loader for use in instance of boot_san + bootloader = BootBootloader(class_id="boot.Bootloader", + object_type="boot.Bootloader", + name="bootloader") + return bootloader + +def create_boot_san(): + # Creating instance of boot_san + san_bootloader = create_bootloader() + boot_san = BootSan(class_id="boot.San", + object_type="boot.San", + name="san1", + interface_name="fc0", + wwpn="50:06:01:62:3E:E0:58:36", + bootloader=san_bootloader, + enabled=True) + return boot_san + + + +def create_boot_precision_policy(): + api_instance = boot_api.BootApi(api_client) + + # Create an instance of local_cdd, local_disk, vmedia, usb, uefi, pxe, san, organization and list of boot_devices. + boot_local_cdd = create_boot_local_cdd() + boot_local_disk = create_boot_local_disk() + boot_vmedia = create_boot_vmedia() + boot_usb = create_boot_usb() + boot_uefi = create_boot_uefi() + boot_pxe = create_boot_pxe() + boot_san = create_boot_san() + organization = create_organization() + boot_devices = [ + boot_local_disk, + boot_local_cdd, + boot_vmedia, + boot_usb, + boot_uefi, + boot_pxe, + boot_san + ] + + # BootPrecisionPolicy | The 'boot.PrecisionPolicy' resource to create. + boot_precision_policy = BootPrecisionPolicy() + + # Setting all the attributes for boot_precison_policy instance. + boot_precision_policy.name = "sample_boot_policy1" + boot_precision_policy.description = "sample boot precision policy" + boot_precision_policy.boot_devices = boot_devices + boot_precision_policy.organization = organization + + try: + # Create a 'boot.PrecisionPolicy' resource. + resp_boot_precision_policy = api_instance.create_boot_precision_policy(boot_precision_policy) + pprint(resp_boot_precision_policy) + return resp_boot_precision_policy + except intersight.ApiException as e: + print("Exception when calling BootApi->create_boot_precision_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of boot precision policy + create_boot_precision_policy() \ No newline at end of file diff --git a/policies/ucs_server_policies/compute/boot_order_policy/readme.md b/policies/ucs_server_policies/compute/boot_order_policy/readme.md new file mode 100644 index 0000000..cf9f8c4 --- /dev/null +++ b/policies/ucs_server_policies/compute/boot_order_policy/readme.md @@ -0,0 +1,4 @@ +## BootOrder Policy +Configures the linear ordering of devices and enables you to change the boot order and boot mode. You can also add multiple devices under various device types, rearrange the boot order, and set parameters for each boot device type. + +The inventory view enables you to view the actual boot order configured on a server. The boot order displays the details that include device name, device type, configuration details such as Boot Mode (Legacy or UEFI), and Secure Boot Mode (Enabled or Disabled). diff --git a/ucs_server/compute/boot_order_policy/terraform/boot_order_policy.tf b/policies/ucs_server_policies/compute/boot_order_policy/terraform/boot_order_policy.tf similarity index 100% rename from ucs_server/compute/boot_order_policy/terraform/boot_order_policy.tf rename to policies/ucs_server_policies/compute/boot_order_policy/terraform/boot_order_policy.tf diff --git a/ucs_server/compute/power_policy/ansible/power_policy.yaml b/policies/ucs_server_policies/compute/power_policy/ansible/power_policy.yaml similarity index 100% rename from ucs_server/compute/power_policy/ansible/power_policy.yaml rename to policies/ucs_server_policies/compute/power_policy/ansible/power_policy.yaml diff --git a/ucs_server/compute/power_policy/openapi/power_policy.json b/policies/ucs_server_policies/compute/power_policy/openapi/power_policy.json similarity index 100% rename from ucs_server/compute/power_policy/openapi/power_policy.json rename to policies/ucs_server_policies/compute/power_policy/openapi/power_policy.json diff --git a/ucs_server/compute/power_policy/powershell/power_policy.ps1 b/policies/ucs_server_policies/compute/power_policy/powershell/power_policy.ps1 similarity index 100% rename from ucs_server/compute/power_policy/powershell/power_policy.ps1 rename to policies/ucs_server_policies/compute/power_policy/powershell/power_policy.ps1 diff --git a/ucs_server/compute/power_policy/python/power_policy.py b/policies/ucs_server_policies/compute/power_policy/python/power_policy.py similarity index 80% rename from ucs_server/compute/power_policy/python/power_policy.py rename to policies/ucs_server_policies/compute/power_policy/python/power_policy.py index 1f50d5d..a0aee7f 100644 --- a/ucs_server/compute/power_policy/python/power_policy.py +++ b/policies/ucs_server_policies/compute/power_policy/python/power_policy.py @@ -16,9 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_power_policy(): @@ -35,7 +36,11 @@ def create_power_policy(): power_policy.description = "sample power policy." power_policy.organization = organization power_policy.dynamic_rebalancing = "Enabled" + power_policy.extended_power_capacity = "Enabled" power_policy.power_priority = "High" + power_policy.power_profiling = "Enabled" + power_policy.power_restore_state = "AlwaysOff" + power_policy.power_save_mode = "Enabled" power_policy.redundancy_mode = "Grid" try: diff --git a/policies/ucs_server_policies/compute/power_policy/readme.md b/policies/ucs_server_policies/compute/power_policy/readme.md new file mode 100644 index 0000000..515d37e --- /dev/null +++ b/policies/ucs_server_policies/compute/power_policy/readme.md @@ -0,0 +1,2 @@ +## Power Policy +Enables the management of power for FI-attached servers and chassis. This policy allows you to set the power profiling, power priority of the server, and the power restore state of the system. diff --git a/ucs_server/compute/power_policy/terraform/power_policy.tf b/policies/ucs_server_policies/compute/power_policy/terraform/power_policy.tf similarity index 100% rename from ucs_server/compute/power_policy/terraform/power_policy.tf rename to policies/ucs_server_policies/compute/power_policy/terraform/power_policy.tf diff --git a/ucs_server/compute/virtual_media_policy/ansible/virtual_media_policy.yaml b/policies/ucs_server_policies/compute/virtual_media_policy/ansible/virtual_media_policy.yaml similarity index 100% rename from ucs_server/compute/virtual_media_policy/ansible/virtual_media_policy.yaml rename to policies/ucs_server_policies/compute/virtual_media_policy/ansible/virtual_media_policy.yaml diff --git a/ucs_server/compute/virtual_media_policy/openapi/virtual_media_policy.json b/policies/ucs_server_policies/compute/virtual_media_policy/openapi/virtual_media_policy.json similarity index 100% rename from ucs_server/compute/virtual_media_policy/openapi/virtual_media_policy.json rename to policies/ucs_server_policies/compute/virtual_media_policy/openapi/virtual_media_policy.json diff --git a/ucs_server/compute/virtual_media_policy/powershell/virtual_media_policy.ps1 b/policies/ucs_server_policies/compute/virtual_media_policy/powershell/virtual_media_policy.ps1 similarity index 100% rename from ucs_server/compute/virtual_media_policy/powershell/virtual_media_policy.ps1 rename to policies/ucs_server_policies/compute/virtual_media_policy/powershell/virtual_media_policy.ps1 diff --git a/ucs_server/compute/virtual_media_policy/python/virtual_media_policy.py b/policies/ucs_server_policies/compute/virtual_media_policy/python/virtual_media_policy.py similarity index 78% rename from ucs_server/compute/virtual_media_policy/python/virtual_media_policy.py rename to policies/ucs_server_policies/compute/virtual_media_policy/python/virtual_media_policy.py index fbf855c..6529f82 100644 --- a/ucs_server/compute/virtual_media_policy/python/virtual_media_policy.py +++ b/policies/ucs_server_policies/compute/virtual_media_policy/python/virtual_media_policy.py @@ -17,9 +17,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_vmedia_policy(): @@ -28,7 +29,9 @@ def create_vmedia_policy(): # Create an instance of organization and virtual media. organization = create_organization() vmedia = VmediaMapping(authentication_protocol="none", - device_type="hdd", + device_type="cdd", + file_location="nfs://10.193.167.6/exports/vms/ucs-c240m5-huu-3.1.3h.iso", + host_name="12.11.11.13", mount_protocol="nfs", volume_name="sample_vol", remote_file="sample_file.img") @@ -40,7 +43,9 @@ def create_vmedia_policy(): vmedia_policy.name = "sample_vmedia_policy1" vmedia_policy.description = "sample virtual media policy." vmedia_policy.organization = organization - vmedia_policy.low_power_usb = False + vmedia_policy.low_power_usb = True + vmedia_policy.enabled = True + vmedia_policy.encryption = True vmedia_policy.mappings = [vmedia] try: diff --git a/policies/ucs_server_policies/compute/virtual_media_policy/readme.md b/policies/ucs_server_policies/compute/virtual_media_policy/readme.md new file mode 100644 index 0000000..c7ef911 --- /dev/null +++ b/policies/ucs_server_policies/compute/virtual_media_policy/readme.md @@ -0,0 +1,2 @@ +## Virtual Media Policy +Enables you to install an operating system on the server using the KVM console and virtual media, mount files to the host from a remote file share, and enable virtual media encryption. You can create one or more Virtual Media policies which contain virtual media mappings for different OS images, and configure up to two virtual media mappings, one for ISO files (through CDD), and the other for IMG files (through HDD). diff --git a/ucs_server/compute/virtual_media_policy/terraform/virtual_media_policy.tf b/policies/ucs_server_policies/compute/virtual_media_policy/terraform/virtual_media_policy.tf similarity index 100% rename from ucs_server/compute/virtual_media_policy/terraform/virtual_media_policy.tf rename to policies/ucs_server_policies/compute/virtual_media_policy/terraform/virtual_media_policy.tf diff --git a/ucs_server/management/imc_access_policy/ansible/imc_access_policy.yaml b/policies/ucs_server_policies/management/imc_access_policy/ansible/imc_access_policy.yaml similarity index 100% rename from ucs_server/management/imc_access_policy/ansible/imc_access_policy.yaml rename to policies/ucs_server_policies/management/imc_access_policy/ansible/imc_access_policy.yaml diff --git a/ucs_server/management/imc_access_policy/openapi/imc_access_policy.json b/policies/ucs_server_policies/management/imc_access_policy/openapi/imc_access_policy.json similarity index 100% rename from ucs_server/management/imc_access_policy/openapi/imc_access_policy.json rename to policies/ucs_server_policies/management/imc_access_policy/openapi/imc_access_policy.json diff --git a/ucs_server/management/imc_access_policy/powershell/imc_access_policy.ps1 b/policies/ucs_server_policies/management/imc_access_policy/powershell/imc_access_policy.ps1 similarity index 100% rename from ucs_server/management/imc_access_policy/powershell/imc_access_policy.ps1 rename to policies/ucs_server_policies/management/imc_access_policy/powershell/imc_access_policy.ps1 diff --git a/ucs_server/management/imc_access_policy/python/imc_access_policy.py b/policies/ucs_server_policies/management/imc_access_policy/python/imc_access_policy.py similarity index 76% rename from ucs_server/management/imc_access_policy/python/imc_access_policy.py rename to policies/ucs_server_policies/management/imc_access_policy/python/imc_access_policy.py index 2ccdd53..2028011 100644 --- a/ucs_server/management/imc_access_policy/python/imc_access_policy.py +++ b/policies/ucs_server_policies/management/imc_access_policy/python/imc_access_policy.py @@ -6,6 +6,8 @@ from intersight.model.ippool_ip_v4_block import IppoolIpV4Block from intersight.model.ippool_ip_v4_config import IppoolIpV4Config from intersight.model.ippool_pool_relationship import IppoolPoolRelationship +from intersight.model.access_address_type import AccessAddressType +from intersight.model.access_configuration_type import AccessConfigurationType from intersight.api import access_api, ippool_api import intersight @@ -20,9 +22,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_ippool_pool_reference(ippool_pool_moid): @@ -63,6 +66,18 @@ def create_ippool_pool(): print("Exception when calling IppoolPool->create_ippool_pool: %s\n" % e) sys.exit(1) +def create_address_type(): + # Create 'access.AddressType' instance + address_type = AccessAddressType(enable_ip_v4=True, + enable_ip_v6=False) + return address_type + +def create_access_configuration_type(): + #Create 'access.ConfigurationType' instance + access_configuration_type = AccessConfigurationType(configure_inband=True, + configure_out_of_band=False) + return access_configuration_type + def create_access_policy(ippool_pool_moid): api_instance = access_api.AccessApi(api_client) @@ -70,6 +85,12 @@ def create_access_policy(ippool_pool_moid): # Create an instance of organization. organization = create_organization() + # Create an instance of AccessAddressType + address_type = create_address_type() + + # Create an instance of AccessConfigurationType + configuration_type = create_access_configuration_type() + # AccessPolicy | The 'access.Policy' resource to create. access_policy = AccessPolicy() @@ -79,6 +100,8 @@ def create_access_policy(ippool_pool_moid): access_policy.organization = organization access_policy.inband_vlan = 333 access_policy.inband_ip_pool = create_ippool_pool_reference(ippool_pool_moid) + access_policy.address_type = address_type + access_policy.configuration_type = configuration_type try: # Create a 'access.Policy' resource. diff --git a/policies/ucs_server_policies/management/imc_access_policy/readme.md b/policies/ucs_server_policies/management/imc_access_policy/readme.md new file mode 100644 index 0000000..56ad63a --- /dev/null +++ b/policies/ucs_server_policies/management/imc_access_policy/readme.md @@ -0,0 +1,3 @@ +## IMC Access Policy +Enables you to configure and manage your network through mapping of IP pools to the server profile. This policy allows you to configure a VLAN and associate it with an IP address through the IP pool address. +In-Band IP addresses, Out-Of-Band IP addresses, or both can be configured using the IMC Access Policy. vKVM, IPMI, SOL, and vMedia using vKVM client can be used with either In-Band or Out-Of-Band IP addresses. SNMP, vMedia, and Syslog are currently supported only with In-band IP address and not with Out-Of-Band IP address. diff --git a/ucs_server/management/imc_access_policy/terraform/imc_access_policy.tf b/policies/ucs_server_policies/management/imc_access_policy/terraform/imc_access_policy.tf similarity index 100% rename from ucs_server/management/imc_access_policy/terraform/imc_access_policy.tf rename to policies/ucs_server_policies/management/imc_access_policy/terraform/imc_access_policy.tf diff --git a/ucs_server/management/local_user_policy/ansible/local_user_policy.yaml b/policies/ucs_server_policies/management/local_user_policy/ansible/local_user_policy.yaml similarity index 100% rename from ucs_server/management/local_user_policy/ansible/local_user_policy.yaml rename to policies/ucs_server_policies/management/local_user_policy/ansible/local_user_policy.yaml diff --git a/ucs_server/management/local_user_policy/openapi/local_user_policy.json b/policies/ucs_server_policies/management/local_user_policy/openapi/local_user_policy.json similarity index 100% rename from ucs_server/management/local_user_policy/openapi/local_user_policy.json rename to policies/ucs_server_policies/management/local_user_policy/openapi/local_user_policy.json diff --git a/ucs_server/management/local_user_policy/powershell/local_user_policy.ps1 b/policies/ucs_server_policies/management/local_user_policy/powershell/local_user_policy.ps1 similarity index 100% rename from ucs_server/management/local_user_policy/powershell/local_user_policy.ps1 rename to policies/ucs_server_policies/management/local_user_policy/powershell/local_user_policy.ps1 diff --git a/policies/ucs_server_policies/management/local_user_policy/python/local_user_policy.py b/policies/ucs_server_policies/management/local_user_policy/python/local_user_policy.py new file mode 100644 index 0000000..0563027 --- /dev/null +++ b/policies/ucs_server_policies/management/local_user_policy/python/local_user_policy.py @@ -0,0 +1,93 @@ +from authentication.python import intersight_authentication as client + +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.iam_end_point_user_policy import IamEndPointUserPolicy +from intersight.model.iam_end_point_user_policy_relationship import IamEndPointUserPolicyRelationship +from intersight.model.iam_end_point_password_properties import IamEndPointPasswordProperties +from intersight.model.iam_end_point_user_role import IamEndPointUserRole +from intersight.model.iam_end_point_role_relationship import IamEndPointRoleRelationship +from intersight.model.iam_end_point_user import IamEndPointUser +from intersight.model.iam_end_point_user_relationship import IamEndPointUserRelationship +from intersight.api import iam_api +import intersight + +from pprint import pprint +import sys + + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + +# Create an instance of the API class. +api_instance = iam_api.IamApi(api_client) + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + + +def create_end_point_user_policy(): + + + # Create an instance of organization and password policy. + organization = create_organization() + password_property = IamEndPointPasswordProperties(class_id="iam.EndPointPasswordProperties", + password_history=5, + enable_password_expiry=False, + enforce_strong_password=True, + force_send_password=False) + + # IamEndPointUserPolicy | The 'iam.EndPointUserPolicy' resource to create. + user_policy = IamEndPointUserPolicy() + + # Setting all the attributes for user_policy instance. + user_policy.name = "sample_user_policy1" + user_policy.description = "sample end point user policy." + user_policy.organization = organization + user_policy.password_properties = password_property + # Create a 'iam.EndPointUserPolicy' resource. + resp_user_policy = api_instance.create_iam_end_point_user_policy(user_policy) + return IamEndPointUserPolicyRelationship(class_id="mo.MoRef", + object_type="iam.EndPointUserPolicy", + moid=resp_user_policy.moid) + +def create_iam_endpoint_role_ref(): + params = {"filter":"Name eq 'admin'"} + api_response = api_instance.get_iam_end_point_role_list(**params) + return IamEndPointRoleRelationship(class_id="mo.MoRef", + object_type="iam.EndPointRole", + moid=api_response.results[0].moid) + +def create_endpoint_user(): + # Create an instance of organization. + organization = create_organization() + endpoint_user = IamEndPointUser(name="guest", + organization=organization) + api_response = api_instance.create_iam_end_point_user(endpoint_user) + return IamEndPointUserRelationship(class_id="mo.MoRef", + object_type="iam.EndPointUser", + moid=api_response.moid) + +def create_end_point_user_role(): + # Create an instance of IamEndPointUserRole + end_point_user_role = IamEndPointUserRole() + end_point_user_role.enabled = True + end_point_user_role.end_point_role = [create_iam_endpoint_role_ref()] + end_point_user_role.password = "admin@1234" + end_point_user_role.end_point_user_policy = create_end_point_user_policy() + end_point_user_role.end_point_user = create_endpoint_user() + try: + api_response = api_instance.create_iam_end_point_user_role(end_point_user_role) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling IamApi->create_iam_end_point_user_role: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of end point user policy + create_end_point_user_role() diff --git a/policies/ucs_server_policies/management/local_user_policy/readme.md b/policies/ucs_server_policies/management/local_user_policy/readme.md new file mode 100644 index 0000000..4a4825e --- /dev/null +++ b/policies/ucs_server_policies/management/local_user_policy/readme.md @@ -0,0 +1,2 @@ +## Local User Policy +Automates the configuration of local user preferences. You can create one or more Local User policies which contain a list of local users that need to be configured. diff --git a/ucs_server/management/local_user_policy/terraform/local_user_policy.tf b/policies/ucs_server_policies/management/local_user_policy/terraform/local_user_policy.tf similarity index 100% rename from ucs_server/management/local_user_policy/terraform/local_user_policy.tf rename to policies/ucs_server_policies/management/local_user_policy/terraform/local_user_policy.tf diff --git a/ucs_server/management/serial_over_lan_policy/ansible/serial_over_lan_policy.yaml b/policies/ucs_server_policies/management/serial_over_lan_policy/ansible/serial_over_lan_policy.yaml similarity index 100% rename from ucs_server/management/serial_over_lan_policy/ansible/serial_over_lan_policy.yaml rename to policies/ucs_server_policies/management/serial_over_lan_policy/ansible/serial_over_lan_policy.yaml diff --git a/ucs_server/management/serial_over_lan_policy/openapi/serial_over_lan_policy.json b/policies/ucs_server_policies/management/serial_over_lan_policy/openapi/serial_over_lan_policy.json similarity index 100% rename from ucs_server/management/serial_over_lan_policy/openapi/serial_over_lan_policy.json rename to policies/ucs_server_policies/management/serial_over_lan_policy/openapi/serial_over_lan_policy.json diff --git a/ucs_server/management/serial_over_lan_policy/powershell/serial_over_lan_policy.ps1 b/policies/ucs_server_policies/management/serial_over_lan_policy/powershell/serial_over_lan_policy.ps1 similarity index 100% rename from ucs_server/management/serial_over_lan_policy/powershell/serial_over_lan_policy.ps1 rename to policies/ucs_server_policies/management/serial_over_lan_policy/powershell/serial_over_lan_policy.ps1 diff --git a/ucs_server/management/serial_over_lan_policy/python/serial_over_lan_policy.py b/policies/ucs_server_policies/management/serial_over_lan_policy/python/serial_over_lan_policy.py similarity index 89% rename from ucs_server/management/serial_over_lan_policy/python/serial_over_lan_policy.py rename to policies/ucs_server_policies/management/serial_over_lan_policy/python/serial_over_lan_policy.py index 2a99ace..2dbb7f6 100644 --- a/ucs_server/management/serial_over_lan_policy/python/serial_over_lan_policy.py +++ b/policies/ucs_server_policies/management/serial_over_lan_policy/python/serial_over_lan_policy.py @@ -16,9 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_sol_policy(): diff --git a/policies/ucs_server_policies/management/serial_over_lan_policy/readme.md b/policies/ucs_server_policies/management/serial_over_lan_policy/readme.md new file mode 100644 index 0000000..4852f94 --- /dev/null +++ b/policies/ucs_server_policies/management/serial_over_lan_policy/readme.md @@ -0,0 +1,2 @@ +## SOL Policy +Enables the input and output of the serial port of a managed system to be redirected over IP. You can create one or more Serial over LAN policies which contain a specific grouping of Serial over LAN attributes that match the needs of a server or a set of servers. diff --git a/ucs_server/management/serial_over_lan_policy/terraform/serial_over_lan_policy.tf b/policies/ucs_server_policies/management/serial_over_lan_policy/terraform/serial_over_lan_policy.tf similarity index 100% rename from ucs_server/management/serial_over_lan_policy/terraform/serial_over_lan_policy.tf rename to policies/ucs_server_policies/management/serial_over_lan_policy/terraform/serial_over_lan_policy.tf diff --git a/ucs_server/management/snmp_policy/ansible/snmp_policy.yaml b/policies/ucs_server_policies/management/snmp_policy/ansible/snmp_policy.yaml similarity index 100% rename from ucs_server/management/snmp_policy/ansible/snmp_policy.yaml rename to policies/ucs_server_policies/management/snmp_policy/ansible/snmp_policy.yaml diff --git a/ucs_server/management/snmp_policy/openapi/snmp_policy.json b/policies/ucs_server_policies/management/snmp_policy/openapi/snmp_policy.json similarity index 100% rename from ucs_server/management/snmp_policy/openapi/snmp_policy.json rename to policies/ucs_server_policies/management/snmp_policy/openapi/snmp_policy.json diff --git a/ucs_server/management/snmp_policy/powershell/snmp_policy.ps1 b/policies/ucs_server_policies/management/snmp_policy/powershell/snmp_policy.ps1 similarity index 90% rename from ucs_server/management/snmp_policy/powershell/snmp_policy.ps1 rename to policies/ucs_server_policies/management/snmp_policy/powershell/snmp_policy.ps1 index c3cc86b..72083a9 100644 --- a/ucs_server/management/snmp_policy/powershell/snmp_policy.ps1 +++ b/policies/ucs_server_policies/management/snmp_policy/powershell/snmp_policy.ps1 @@ -20,6 +20,6 @@ $snmpUser = Initialize-IntersightSnmpUser -AuthType MD5 -Name user1 -PrivacyPass -SecurityLevel AuthPriv # create a SNMP policy -$result = New-IntersightSnmpPolicy -Name "snmp_policy" -AccessCommunityString accCommString -CommunityAccess Disabled ` +$result = New-IntersightSnmpPolicy -Name "snmp_policy_1" -AccessCommunityString accCommString -CommunityAccess Disabled ` -Enabled $true -EngineId "EngineID" -SnmpPort 161 -SysContact "xyz@test.com" -SysLocation "NYK" -Organization $orgRef ` -SnmpTraps @($snmpTrap) -SnmpUsers @($snmpUser) \ No newline at end of file diff --git a/ucs_domain/snmp_policy/python/snmp_policy.py b/policies/ucs_server_policies/management/snmp_policy/python/snmp_policy.py similarity index 74% rename from ucs_domain/snmp_policy/python/snmp_policy.py rename to policies/ucs_server_policies/management/snmp_policy/python/snmp_policy.py index f0289c8..389c2e1 100644 --- a/ucs_domain/snmp_policy/python/snmp_policy.py +++ b/policies/ucs_server_policies/management/snmp_policy/python/snmp_policy.py @@ -3,6 +3,7 @@ from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.snmp_policy import SnmpPolicy from intersight.model.snmp_user import SnmpUser +from intersight.model.snmp_trap import SnmpTrap from intersight.api import snmp_api import intersight @@ -17,10 +18,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_snmp_policy(): # Create an instance of the API class @@ -36,6 +37,14 @@ def create_snmp_policy(): name="user1", auth_password="Auth_Snmp_user1", privacy_password="Priv_Snmp_user1") + snmp_trap = SnmpTrap(class_id="snmp.Trap", + object_type="snmp.Trap", + community="trapCommString", + destination="11.11.11.11", + enabled=True, + port=162, + type="Trap", + version="V2") # SnmpPolicy | The 'snmp.Policy' resource to create. snmp_policy = SnmpPolicy() @@ -50,6 +59,10 @@ def create_snmp_policy(): snmp_policy.snmp_port = 161 snmp_policy.sys_contact = "DA" snmp_policy.snmp_users = [snmp_user] + snmp_policy.access_community_string = "access_comm_string" + snmp_policy.community_access = "Disabled" + snmp_policy.sys_location = "NYK" + snmp_policy.snmp_traps = [snmp_trap] snmp_policy.organization = organization # Example passing only required values which don't have defaults set diff --git a/policies/ucs_server_policies/management/snmp_policy/readme.md b/policies/ucs_server_policies/management/snmp_policy/readme.md new file mode 100644 index 0000000..419b625 --- /dev/null +++ b/policies/ucs_server_policies/management/snmp_policy/readme.md @@ -0,0 +1,2 @@ +## Simple Network Management Protocol (SNMP) Policy +Configures the SNMP settings for sending fault and alert information by SNMP traps from the managed devices. Any existing SNMP Users or SNMP Traps configured previously on the managed devices are removed and replaced with users or traps that you configure in this policy. If you have not added any users or traps in the policy, the existing users or traps on the server are removed but not replaced. diff --git a/ucs_server/management/snmp_policy/terraform/snmp_policy.tf b/policies/ucs_server_policies/management/snmp_policy/terraform/snmp_policy.tf similarity index 100% rename from ucs_server/management/snmp_policy/terraform/snmp_policy.tf rename to policies/ucs_server_policies/management/snmp_policy/terraform/snmp_policy.tf diff --git a/ucs_server/management/syslog_policy/ansible/syslog_policy.yaml b/policies/ucs_server_policies/management/syslog_policy/ansible/syslog_policy.yaml similarity index 100% rename from ucs_server/management/syslog_policy/ansible/syslog_policy.yaml rename to policies/ucs_server_policies/management/syslog_policy/ansible/syslog_policy.yaml diff --git a/ucs_server/management/syslog_policy/openapi/syslog_policy.json b/policies/ucs_server_policies/management/syslog_policy/openapi/syslog_policy.json similarity index 100% rename from ucs_server/management/syslog_policy/openapi/syslog_policy.json rename to policies/ucs_server_policies/management/syslog_policy/openapi/syslog_policy.json diff --git a/ucs_server/management/syslog_policy/powershell/syslog_policy.ps1 b/policies/ucs_server_policies/management/syslog_policy/powershell/syslog_policy.ps1 similarity index 100% rename from ucs_server/management/syslog_policy/powershell/syslog_policy.ps1 rename to policies/ucs_server_policies/management/syslog_policy/powershell/syslog_policy.ps1 diff --git a/ucs_server/management/syslog_policy/python/syslog_policy.py b/policies/ucs_server_policies/management/syslog_policy/python/syslog_policy.py similarity index 69% rename from ucs_server/management/syslog_policy/python/syslog_policy.py rename to policies/ucs_server_policies/management/syslog_policy/python/syslog_policy.py index f1a07b1..46e43d9 100644 --- a/ucs_server/management/syslog_policy/python/syslog_policy.py +++ b/policies/ucs_server_policies/management/syslog_policy/python/syslog_policy.py @@ -3,6 +3,7 @@ from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.syslog_policy import SyslogPolicy from intersight.model.syslog_local_client_base import SyslogLocalClientBase +from intersight.model.syslog_remote_client_base import SyslogRemoteClientBase from intersight.api import syslog_api import intersight @@ -17,10 +18,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_syslog_policy(): api_instance = syslog_api.SyslogApi(api_client) @@ -30,6 +31,13 @@ def create_syslog_policy(): syslog_client = SyslogLocalClientBase(class_id="syslog.LocalFileLoggingClient", object_type="syslog.LocalFileLoggingClient", min_severity="warning") + syslog_remote_client = SyslogRemoteClientBase(class_id="syslog.RemoteLoggingClient", + object_type="syslog.RemoteLoggingClient", + enabled=True, + hostname="11.11.11.11", + min_severity="warning", + port=514, + protocol="udp") # SyslogPolicy | The 'syslog.Policy' resource to create. syslog_policy = SyslogPolicy() @@ -39,6 +47,7 @@ def create_syslog_policy(): syslog_policy.description = "sample syslog policy." syslog_policy.organization = organization syslog_policy.local_clients = [syslog_client] + syslog_policy.remote_clients = [syslog_remote_client] # Example passing only required values which don't have defaults set diff --git a/policies/ucs_server_policies/management/syslog_policy/readme.md b/policies/ucs_server_policies/management/syslog_policy/readme.md new file mode 100644 index 0000000..e7cd5eb --- /dev/null +++ b/policies/ucs_server_policies/management/syslog_policy/readme.md @@ -0,0 +1,2 @@ +## Syslog Policy +Defines the logging level (minimum severity) to report for a log file collected from an endpoint, the target destination to store the Syslog messages, and the Hostname/IP Address, port information, and communication protocol for the Remote Logging Server(s). diff --git a/ucs_server/management/syslog_policy/terraform/syslog_policy.tf b/policies/ucs_server_policies/management/syslog_policy/terraform/syslog_policy.tf similarity index 100% rename from ucs_server/management/syslog_policy/terraform/syslog_policy.tf rename to policies/ucs_server_policies/management/syslog_policy/terraform/syslog_policy.tf diff --git a/ucs_server/management/virtual_kvm_policy/ansible/virtual_kvm_policy.yaml b/policies/ucs_server_policies/management/virtual_kvm_policy/ansible/virtual_kvm_policy.yaml similarity index 100% rename from ucs_server/management/virtual_kvm_policy/ansible/virtual_kvm_policy.yaml rename to policies/ucs_server_policies/management/virtual_kvm_policy/ansible/virtual_kvm_policy.yaml diff --git a/ucs_server/management/virtual_kvm_policy/openapi/virtual_kvm_policy.json b/policies/ucs_server_policies/management/virtual_kvm_policy/openapi/virtual_kvm_policy.json similarity index 100% rename from ucs_server/management/virtual_kvm_policy/openapi/virtual_kvm_policy.json rename to policies/ucs_server_policies/management/virtual_kvm_policy/openapi/virtual_kvm_policy.json diff --git a/ucs_server/management/virtual_kvm_policy/powershell/virtual_kvm_policy.ps1 b/policies/ucs_server_policies/management/virtual_kvm_policy/powershell/virtual_kvm_policy.ps1 similarity index 100% rename from ucs_server/management/virtual_kvm_policy/powershell/virtual_kvm_policy.ps1 rename to policies/ucs_server_policies/management/virtual_kvm_policy/powershell/virtual_kvm_policy.ps1 diff --git a/ucs_server/management/virtual_kvm_policy/python/virtual_kvm_policy.py b/policies/ucs_server_policies/management/virtual_kvm_policy/python/virtual_kvm_policy.py similarity index 84% rename from ucs_server/management/virtual_kvm_policy/python/virtual_kvm_policy.py rename to policies/ucs_server_policies/management/virtual_kvm_policy/python/virtual_kvm_policy.py index a7bb3f0..a3dec9a 100644 --- a/ucs_server/management/virtual_kvm_policy/python/virtual_kvm_policy.py +++ b/policies/ucs_server_policies/management/virtual_kvm_policy/python/virtual_kvm_policy.py @@ -16,10 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - + object_type="organization.Organization", + moid="moid_of_organization") def create_kvm_policy(): api_instance = kvm_api.KvmApi(api_client) @@ -37,6 +37,8 @@ def create_kvm_policy(): kvm_policy.maximum_sessions = 3 kvm_policy.remote_port = 33333 kvm_policy.enabled = True + kvm_policy.enable_video_encryption = True + kvm_policy.enable_local_server_video = True # Example passing only required values which don't have defaults set try: diff --git a/policies/ucs_server_policies/management/virtual_kvm_policy/readme.md b/policies/ucs_server_policies/management/virtual_kvm_policy/readme.md new file mode 100644 index 0000000..1c24e0a --- /dev/null +++ b/policies/ucs_server_policies/management/virtual_kvm_policy/readme.md @@ -0,0 +1,2 @@ +## Virtual KVM +Enables specific grouping of virtual KVM properties. This policy lets you specify the number of allowed concurrent KVM sessions, port information, and video encryption options. diff --git a/ucs_server/management/virtual_kvm_policy/terraform/virtual_kvm_policy.tf b/policies/ucs_server_policies/management/virtual_kvm_policy/terraform/virtual_kvm_policy.tf similarity index 100% rename from ucs_server/management/virtual_kvm_policy/terraform/virtual_kvm_policy.tf rename to policies/ucs_server_policies/management/virtual_kvm_policy/terraform/virtual_kvm_policy.tf diff --git a/ucs_server/misc/ldap_policy/ansible/ldap_policy.yaml b/policies/ucs_server_policies/misc/ldap_policy/ansible/ldap_policy.yaml similarity index 100% rename from ucs_server/misc/ldap_policy/ansible/ldap_policy.yaml rename to policies/ucs_server_policies/misc/ldap_policy/ansible/ldap_policy.yaml diff --git a/ucs_server/misc/ldap_policy/openapi/ldap_policy.json b/policies/ucs_server_policies/misc/ldap_policy/openapi/ldap_policy.json similarity index 100% rename from ucs_server/misc/ldap_policy/openapi/ldap_policy.json rename to policies/ucs_server_policies/misc/ldap_policy/openapi/ldap_policy.json diff --git a/ucs_server/misc/ldap_policy/powershell/ldap_policy.ps1 b/policies/ucs_server_policies/misc/ldap_policy/powershell/ldap_policy.ps1 similarity index 100% rename from ucs_server/misc/ldap_policy/powershell/ldap_policy.ps1 rename to policies/ucs_server_policies/misc/ldap_policy/powershell/ldap_policy.ps1 diff --git a/policies/ucs_server_policies/misc/ldap_policy/python/ldap_policy.py b/policies/ucs_server_policies/misc/ldap_policy/python/ldap_policy.py new file mode 100644 index 0000000..8ca56ce --- /dev/null +++ b/policies/ucs_server_policies/misc/ldap_policy/python/ldap_policy.py @@ -0,0 +1,99 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import iam_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.iam_ldap_policy import IamLdapPolicy +from intersight.model.iam_ldap_base_properties import IamLdapBaseProperties +from intersight.model.iam_end_point_role_relationship import IamEndPointRoleRelationship +from intersight.model.iam_ldap_policy_relationship import IamLdapPolicyRelationship +from intersight.model.iam_end_point_role_relationship import IamEndPointRoleRelationship +from intersight.model.iam_ldap_provider import IamLdapProvider +from intersight.model.iam_ldap_provider_relationship import IamLdapProviderRelationship +from intersight.model.iam_ldap_group import IamLdapGroup + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +# Create an instance of the API class. +api_instance = iam_api.IamApi(api_client) + +def iam_ldap_base_properties(): + # IamLdapBaseProperties | The 'IamLdapBaseProperties' resource to create. + base_prop = IamLdapBaseProperties() + # Setting all the attributes for base_prop instance. + base_prop.BaseDn = "intersight" + base_prop.Domain = "cisco.com" + base_prop.Timeout = 60 + base_prop.EnableEncryption = False + base_prop.BindMethod = "LoginCredentials" + base_prop.Filter = "cisco" + base_prop.GroupAttribute = "intersight" + base_prop.Attribute = "test" + base_prop.EnableGroupAuthorization = False + base_prop.NestedGroupSearchDepth = 128 + return base_prop + + +def create_ldap_policy(): + # Create an instance of organization. + organization = create_organization() + base_prop = iam_ldap_base_properties() + # IamLdapPolicy | The 'IamLdap.Policy' resource to create. + iam_ldap_pol1 = IamLdapPolicy(name="sample_ldap_policy", base_properties=base_prop, EnableDns=False, organization=organization) + # Create a 'IamLdap.Policy' resource. + api_response1 = api_instance.create_iam_ldap_policy(iam_ldap_pol1) + return api_response1 + + +def create_ldap_policy_ref(ldap_policy): + return IamLdapPolicyRelationship(class_id="mo.MoRef", + object_type="iam.LdapPolicy", + moid=ldap_policy.moid) + +def create_iam_endpoint_role_ref(): + params = {"filter":"Name eq 'admin'"} + api_response = api_instance.get_iam_end_point_role_list(**params) + return IamEndPointRoleRelationship(class_id="mo.MoRef", + object_type="iam.EndPointRole", + moid=api_response.results[0].moid) + +def create_ldap_provider_ref(ldap_policy_ref): + ldap_provider = IamLdapProvider(port=389, + server="ldap.xyz.com", + ldap_policy=ldap_policy_ref) + api_response = api_instance.create_iam_ldap_provider(ldap_provider) + return IamLdapProviderRelationship(class_id="mo.MoRef", + object_type="iam.LdapProvider", + moid=api_response.moid) + +def create_ldap_group(ldap_policy, endpoint_role): + # Create an instance of ldap group + ldap_group = IamLdapGroup(domain="xyz.com", + name="ldap_group", + ldap_policy=ldap_policy, + end_point_role=[endpoint_role]) + try: + api_response = api_instance.create_iam_ldap_group(ldap_group) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling IamApi->create_iam_ldap_group: %s\n" % e) + sys.exit(1) + +if __name__ == "__main__": + # Trigger creation of ldap policy + ldap_policy = create_ldap_policy() + ldap_policy_ref= create_ldap_policy_ref(ldap_policy) + endpoint_role_ref = create_iam_endpoint_role_ref() + ldap_provider_ref = create_ldap_provider_ref(ldap_policy_ref) + create_ldap_group(ldap_policy_ref, endpoint_role_ref) diff --git a/policies/ucs_server_policies/misc/ldap_policy/readme.md b/policies/ucs_server_policies/misc/ldap_policy/readme.md new file mode 100644 index 0000000..dca9546 --- /dev/null +++ b/policies/ucs_server_policies/misc/ldap_policy/readme.md @@ -0,0 +1,2 @@ +## LDAP Policy +Specifies the LDAP configuration settings and preferences for an endpoint. The endpoints support LDAP to store and maintain directory information in a network. The LDAP policy determines configuration settings for LDAP Servers, DNS parameters including options to obtain a domain name used for the DNS SRV request, Binding methods, Search parameters, and Group Authorization preferences. Through an LDAP policy, you can also create multiple LDAP groups and add them to the LDAP server database. diff --git a/ucs_server/misc/ldap_policy/terraform/ldap_policy.tf b/policies/ucs_server_policies/misc/ldap_policy/terraform/ldap_policy.tf similarity index 100% rename from ucs_server/misc/ldap_policy/terraform/ldap_policy.tf rename to policies/ucs_server_policies/misc/ldap_policy/terraform/ldap_policy.tf diff --git a/ucs_server/misc/ntp_policy/ansible/ntp_policy.yaml b/policies/ucs_server_policies/misc/ntp_policy/ansible/ntp_policy.yaml similarity index 100% rename from ucs_server/misc/ntp_policy/ansible/ntp_policy.yaml rename to policies/ucs_server_policies/misc/ntp_policy/ansible/ntp_policy.yaml diff --git a/ucs_server/misc/ntp_policy/openapi/ntp_policy.json b/policies/ucs_server_policies/misc/ntp_policy/openapi/ntp_policy.json similarity index 100% rename from ucs_server/misc/ntp_policy/openapi/ntp_policy.json rename to policies/ucs_server_policies/misc/ntp_policy/openapi/ntp_policy.json diff --git a/ucs_server/misc/ntp_policy/powershell/ntp_policy.ps1 b/policies/ucs_server_policies/misc/ntp_policy/powershell/ntp_policy.ps1 similarity index 100% rename from ucs_server/misc/ntp_policy/powershell/ntp_policy.ps1 rename to policies/ucs_server_policies/misc/ntp_policy/powershell/ntp_policy.ps1 diff --git a/ucs_server/misc/ntp_policy/python/ntp_policy.py b/policies/ucs_server_policies/misc/ntp_policy/python/ntp_policy.py similarity index 51% rename from ucs_server/misc/ntp_policy/python/ntp_policy.py rename to policies/ucs_server_policies/misc/ntp_policy/python/ntp_policy.py index aeb091b..b0cdd93 100644 --- a/ucs_server/misc/ntp_policy/python/ntp_policy.py +++ b/policies/ucs_server_policies/misc/ntp_policy/python/ntp_policy.py @@ -3,6 +3,7 @@ from authentication.python import intersight_authentication as client from intersight.api import ntp_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.ntp_policy import NtpPolicy api_key = "api_key" @@ -11,11 +12,23 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_ntp_policy(): # Create an instance of the API class. api_instance = ntp_api.NtpApi(api_client) + # Create an instance of organization. + organization = create_organization() # NtpPolicy | The 'Ntp.Policy' resource to create. - ntp_pol = NtpPolicy(name="sample_ntp_policy", ntp_servers=["1.1.1.1"]) + ntp_pol = NtpPolicy(name="sample_ntp_policy", + ntp_servers=["1.1.1.1"], + enabled=True, + timezone="Indian/Mauritius", + organization=organization) try: # Create a 'Ntp.Policy' resource. api_response = api_instance.create_ntp_policy(ntp_pol) diff --git a/policies/ucs_server_policies/misc/ntp_policy/readme.md b/policies/ucs_server_policies/misc/ntp_policy/readme.md new file mode 100644 index 0000000..c2567b9 --- /dev/null +++ b/policies/ucs_server_policies/misc/ntp_policy/readme.md @@ -0,0 +1,2 @@ +## NTP Policy +Allows you to enable the NTP service on an Intersight Managed Cisco IMC (Standalone) server. The NTP service synchronizes the time with an NTP server. You must enable and configure the NTP service by specifying the IP address or DNS of a minimum of one to a maximum of four NTP servers. diff --git a/ucs_server/misc/ntp_policy/terraform/ntp_policy.tf b/policies/ucs_server_policies/misc/ntp_policy/terraform/ntp_policy.tf similarity index 100% rename from ucs_server/misc/ntp_policy/terraform/ntp_policy.tf rename to policies/ucs_server_policies/misc/ntp_policy/terraform/ntp_policy.tf diff --git a/ucs_server/misc/smtp_policy/ansible/smtp_policy.yaml b/policies/ucs_server_policies/misc/smtp_policy/ansible/smtp_policy.yaml similarity index 100% rename from ucs_server/misc/smtp_policy/ansible/smtp_policy.yaml rename to policies/ucs_server_policies/misc/smtp_policy/ansible/smtp_policy.yaml diff --git a/ucs_server/misc/smtp_policy/openapi/smtp_policy.json b/policies/ucs_server_policies/misc/smtp_policy/openapi/smtp_policy.json similarity index 100% rename from ucs_server/misc/smtp_policy/openapi/smtp_policy.json rename to policies/ucs_server_policies/misc/smtp_policy/openapi/smtp_policy.json diff --git a/ucs_server/misc/smtp_policy/powershell/smtp_policy.ps1 b/policies/ucs_server_policies/misc/smtp_policy/powershell/smtp_policy.ps1 similarity index 100% rename from ucs_server/misc/smtp_policy/powershell/smtp_policy.ps1 rename to policies/ucs_server_policies/misc/smtp_policy/powershell/smtp_policy.ps1 diff --git a/policies/ucs_server_policies/misc/smtp_policy/python/smtp_policy.py b/policies/ucs_server_policies/misc/smtp_policy/python/smtp_policy.py new file mode 100644 index 0000000..d40e71a --- /dev/null +++ b/policies/ucs_server_policies/misc/smtp_policy/python/smtp_policy.py @@ -0,0 +1,45 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.api import smtp_api +from intersight.model.smtp_policy import SmtpPolicy + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_smtp_policy(): + # Create an instance of the API class. + api_instance = smtp_api.SmtpApi(api_client) + # Create an instance of organization. + organization = create_organization() + # SmtpPolicy | The 'Smtp.Policy' resource to create. + smtp_pol = SmtpPolicy(name="sample_smtp", + smtp_server="samplesmtp.intersight.com", + organization=organization, + min_severity="critical", + enabled=True, + smtp_port=25, + smtp_recipients=["xyz@test.com"]) + try: + # Create a 'Smtp.Policy' resource. + api_response = api_instance.create_smtp_policy(smtp_pol) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling SmtpApi->create_smtp_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of smtp policy + create_smtp_policy() diff --git a/policies/ucs_server_policies/misc/smtp_policy/readme.md b/policies/ucs_server_policies/misc/smtp_policy/readme.md new file mode 100644 index 0000000..4a4f760 --- /dev/null +++ b/policies/ucs_server_policies/misc/smtp_policy/readme.md @@ -0,0 +1,2 @@ +## SMTP Policy +Sets the state of the SMTP client in the managed device. You can specify the preferred settings for outgoing communication and select the fault severity level to report and the mail recipients. diff --git a/ucs_server/misc/smtp_policy/terraform/smtp_policy.tf b/policies/ucs_server_policies/misc/smtp_policy/terraform/smtp_policy.tf similarity index 100% rename from ucs_server/misc/smtp_policy/terraform/smtp_policy.tf rename to policies/ucs_server_policies/misc/smtp_policy/terraform/smtp_policy.tf diff --git a/ucs_server/misc/ssh_policy/ansible/ssh_policy.yaml b/policies/ucs_server_policies/misc/ssh_policy/ansible/ssh_policy.yaml similarity index 100% rename from ucs_server/misc/ssh_policy/ansible/ssh_policy.yaml rename to policies/ucs_server_policies/misc/ssh_policy/ansible/ssh_policy.yaml diff --git a/ucs_server/misc/ssh_policy/openapi/ssh_policy.json b/policies/ucs_server_policies/misc/ssh_policy/openapi/ssh_policy.json similarity index 100% rename from ucs_server/misc/ssh_policy/openapi/ssh_policy.json rename to policies/ucs_server_policies/misc/ssh_policy/openapi/ssh_policy.json diff --git a/ucs_server/misc/ssh_policy/powershell/ssh_policy.ps1 b/policies/ucs_server_policies/misc/ssh_policy/powershell/ssh_policy.ps1 similarity index 100% rename from ucs_server/misc/ssh_policy/powershell/ssh_policy.ps1 rename to policies/ucs_server_policies/misc/ssh_policy/powershell/ssh_policy.ps1 diff --git a/ucs_server/misc/ssh_policy/python/ssh_policy.py b/policies/ucs_server_policies/misc/ssh_policy/python/ssh_policy.py similarity index 52% rename from ucs_server/misc/ssh_policy/python/ssh_policy.py rename to policies/ucs_server_policies/misc/ssh_policy/python/ssh_policy.py index ae298f3..cc51667 100644 --- a/ucs_server/misc/ssh_policy/python/ssh_policy.py +++ b/policies/ucs_server_policies/misc/ssh_policy/python/ssh_policy.py @@ -2,6 +2,7 @@ import sys from authentication.python import intersight_authentication as client +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.api import ssh_api from intersight.model.ssh_policy import SshPolicy @@ -11,11 +12,23 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_ssh_policy(): # Create an instance of the API class. api_instance = ssh_api.SshApi(api_client) + # Create an instance of organization. + organization = create_organization() # SshPolicy | The 'Ssh.Policy' resource to create. - ssh_pol = SshPolicy(name="sample_ssh_policy") + ssh_pol = SshPolicy(name="sample_ssh_policy", + description="ssh policy", + port=12000, + timeout=1800, + organization=organization) try: # Create a 'Ssh.Policy' resource. api_response = api_instance.create_ssh_policy(ssh_pol) diff --git a/policies/ucs_server_policies/misc/ssh_policy/readme.md b/policies/ucs_server_policies/misc/ssh_policy/readme.md new file mode 100644 index 0000000..50f1d24 --- /dev/null +++ b/policies/ucs_server_policies/misc/ssh_policy/readme.md @@ -0,0 +1,2 @@ +## SSH Policy +Enables an SSH client to make a secure, encrypted connection. You can create one or more SSH policies that contain a specific grouping of SSH properties for a server or a set of servers. diff --git a/ucs_server/misc/ssh_policy/terraform/ssh_policy.tf b/policies/ucs_server_policies/misc/ssh_policy/terraform/ssh_policy.tf similarity index 100% rename from ucs_server/misc/ssh_policy/terraform/ssh_policy.tf rename to policies/ucs_server_policies/misc/ssh_policy/terraform/ssh_policy.tf diff --git a/ucs_server/network/adapter_configuation_policy/ansible/adapter_configuation_policy.yaml b/policies/ucs_server_policies/network/adapter_configuation_policy/ansible/adapter_configuation_policy.yaml similarity index 100% rename from ucs_server/network/adapter_configuation_policy/ansible/adapter_configuation_policy.yaml rename to policies/ucs_server_policies/network/adapter_configuation_policy/ansible/adapter_configuation_policy.yaml diff --git a/ucs_server/network/adapter_configuation_policy/openapi/adapter_configuation_policy.json b/policies/ucs_server_policies/network/adapter_configuation_policy/openapi/adapter_configuation_policy.json similarity index 100% rename from ucs_server/network/adapter_configuation_policy/openapi/adapter_configuation_policy.json rename to policies/ucs_server_policies/network/adapter_configuation_policy/openapi/adapter_configuation_policy.json diff --git a/ucs_server/network/adapter_configuation_policy/powershell/adapter_configuation_policy.ps1 b/policies/ucs_server_policies/network/adapter_configuation_policy/powershell/adapter_configuation_policy.ps1 similarity index 100% rename from ucs_server/network/adapter_configuation_policy/powershell/adapter_configuation_policy.ps1 rename to policies/ucs_server_policies/network/adapter_configuation_policy/powershell/adapter_configuation_policy.ps1 diff --git a/ucs_server/network/adapter_configuation_policy/python/adapter_configuation_policy.py b/policies/ucs_server_policies/network/adapter_configuation_policy/python/adapter_configuation_policy.py similarity index 72% rename from ucs_server/network/adapter_configuation_policy/python/adapter_configuation_policy.py rename to policies/ucs_server_policies/network/adapter_configuation_policy/python/adapter_configuation_policy.py index 84b5380..a7413fd 100644 --- a/ucs_server/network/adapter_configuation_policy/python/adapter_configuation_policy.py +++ b/policies/ucs_server_policies/network/adapter_configuation_policy/python/adapter_configuation_policy.py @@ -3,6 +3,7 @@ from authentication.python import intersight_authentication as client from intersight.api import adapter_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.adapter_config_policy import AdapterConfigPolicy from intersight.model.adapter_adapter_config import AdapterAdapterConfig from intersight.model.adapter_eth_settings import AdapterEthSettings @@ -17,14 +18,23 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_adapter_configuration_policy(): # Create an instance of the API class. api_instance = adapter_api.AdapterApi(api_client) + # Create an instance of organization. + organization = create_organization() + adaptor_fc_settings = AdapterFcSettings(FipEnabled=True) adaptor_port_channel_settings = AdapterPortChannelSettings(Enabled=True) adapter_eth_settings = AdapterEthSettings(LldpEnabled=True) - # adapter_dce_interface_settings = AdapterDceInterfaceSettings() + adapter_dce_interface_settings = AdapterDceInterfaceSettings(FecMode="cl91",InterfaceId=1) # Settings the attributes for Adapter policy adaptor_adaptor_config = AdapterAdapterConfig() @@ -32,11 +42,12 @@ def create_adapter_configuration_policy(): adaptor_adaptor_config.EthSettings = adapter_eth_settings adaptor_adaptor_config.FcSettings = adaptor_fc_settings adaptor_adaptor_config.PortChannelSettings = adaptor_port_channel_settings - # adaptor_adaptor_config.DceInterfaceSettings = adapter_dce_interface_settings + adaptor_adaptor_config.DceInterfaceSettings = [adapter_dce_interface_settings] # AdapterConfigPolicy | The 'AdapterConfig.Policy' resource to create. adaptor_config_policy = AdapterConfigPolicy(name="sample_acp_policy") adaptor_config_policy.settings = [adaptor_adaptor_config] + adaptor_config_policy.organization = organization try: # Create a 'AdapterConfig.Policy' resource. diff --git a/policies/ucs_server_policies/network/adapter_configuation_policy/readme.md b/policies/ucs_server_policies/network/adapter_configuation_policy/readme.md new file mode 100644 index 0000000..11084b3 --- /dev/null +++ b/policies/ucs_server_policies/network/adapter_configuation_policy/readme.md @@ -0,0 +1,3 @@ +## Adapter Configuration Policy +Configures the Ethernet and Fibre-Channel settings for the VIC adapter. + diff --git a/ucs_server/network/adapter_configuation_policy/terraform/adapter_configuation_policy.tf b/policies/ucs_server_policies/network/adapter_configuation_policy/terraform/adapter_configuation_policy.tf similarity index 100% rename from ucs_server/network/adapter_configuation_policy/terraform/adapter_configuation_policy.tf rename to policies/ucs_server_policies/network/adapter_configuation_policy/terraform/adapter_configuation_policy.tf diff --git a/ucs_server/network/ethernet_adapter_policy/ansible/ethernet_adapter_policy.yaml b/policies/ucs_server_policies/network/ethernet_adapter_policy/ansible/ethernet_adapter_policy.yaml similarity index 100% rename from ucs_server/network/ethernet_adapter_policy/ansible/ethernet_adapter_policy.yaml rename to policies/ucs_server_policies/network/ethernet_adapter_policy/ansible/ethernet_adapter_policy.yaml diff --git a/ucs_server/network/ethernet_adapter_policy/openapi/ethernet_adapter_policy.json b/policies/ucs_server_policies/network/ethernet_adapter_policy/openapi/ethernet_adapter_policy.json similarity index 100% rename from ucs_server/network/ethernet_adapter_policy/openapi/ethernet_adapter_policy.json rename to policies/ucs_server_policies/network/ethernet_adapter_policy/openapi/ethernet_adapter_policy.json diff --git a/ucs_server/network/ethernet_adapter_policy/powershell/ethernet_adapter_policy.ps1 b/policies/ucs_server_policies/network/ethernet_adapter_policy/powershell/ethernet_adapter_policy.ps1 similarity index 100% rename from ucs_server/network/ethernet_adapter_policy/powershell/ethernet_adapter_policy.ps1 rename to policies/ucs_server_policies/network/ethernet_adapter_policy/powershell/ethernet_adapter_policy.ps1 diff --git a/policies/ucs_server_policies/network/ethernet_adapter_policy/python/ethernet_adapter_policy.py b/policies/ucs_server_policies/network/ethernet_adapter_policy/python/ethernet_adapter_policy.py new file mode 100644 index 0000000..e3601c4 --- /dev/null +++ b/policies/ucs_server_policies/network/ethernet_adapter_policy/python/ethernet_adapter_policy.py @@ -0,0 +1,99 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.vnic_eth_adapter_policy import VnicEthAdapterPolicy +from intersight.model.vnic_arfs_settings import VnicArfsSettings +from intersight.model.vnic_completion_queue_settings import VnicCompletionQueueSettings +from intersight.model.vnic_eth_interrupt_settings import VnicEthInterruptSettings +from intersight.model.vnic_nvgre_settings import VnicNvgreSettings +from intersight.model.vnic_ptp_settings import VnicPtpSettings +from intersight.model.vnic_roce_settings import VnicRoceSettings +from intersight.model.vnic_rss_hash_settings import VnicRssHashSettings +from intersight.model.vnic_eth_rx_queue_settings import VnicEthRxQueueSettings +from intersight.model.vnic_tcp_offload_settings import VnicTcpOffloadSettings +from intersight.model.vnic_eth_tx_queue_settings import VnicEthTxQueueSettings +from intersight.model.vnic_vxlan_settings import VnicVxlanSettings + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_ethernet_adapter_policy(): + # Create an instance of the API class. + api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create instance of VnicArfsSettings + vnic_arfs_settings = VnicArfsSettings(enabled=True) + # Create instance of VnicCompletionQueueSettings + completion_queue = VnicCompletionQueueSettings(count=5, ring_size=1) + # Create instance of VnicEthInterruptSettings + eth_interrupt_settings = VnicEthInterruptSettings(coalescing_time=125, + coalescing_type="MIN", + mode="MSIx", + count=8) + # Create instance of VnicNvgreSettings + nvgre_settings = VnicNvgreSettings(enabled=True) + # Create instance of VnicPtpSettings + ptp_settings = VnicPtpSettings(enabled=True) + # Create instance of VnicRoceSettings + roce_settings = VnicRoceSettings(class_of_service=5, + enabled=True, + memory_regions=131072, + queue_pairs=256, + resource_groups=4, + version=1) + # Create instance of VnicRssHashSettings + rss_hash_settings = VnicRssHashSettings(ipv4_hash=True, + tcp_ipv4_hash=True) + # Create instance of VnicEthRxQueueSettings + rx_queue_settings = VnicEthRxQueueSettings(count=4, ring_size=512) + # Create instance of VnicTcpOffloadSettings + tcp_offload_settings = VnicTcpOffloadSettings(large_receive=True, + large_send=True, + rx_checksum=True, + tx_checksum=True) + # Create instance of VnicEthTxQueueSettings + tx_queue_settings = VnicEthTxQueueSettings(count=1, + ring_size=256) + # Create instance of VnicVxlanSettings + vxlan_settings = VnicVxlanSettings(enabled=True) + + # VnicEthAdapterPolicy | The 'VnicEthAdapter.Policy' resource to create. + vnic_eth_adapter_policy = VnicEthAdapterPolicy(name="sample_ethernet_adapter_policy", + organization=organization, + advanced_filter=True, + arfs_settings=vnic_arfs_settings, + completion_queue_settings=completion_queue, + interrupt_settings=eth_interrupt_settings, + ptp_settings=ptp_settings, + roce_settings=roce_settings, + rss_hash_settings=rss_hash_settings, + rss_settings=True, + rx_queue_settings=rx_queue_settings, + tcp_offload_settings=tcp_offload_settings, + tx_queue_settings=tx_queue_settings, + vxlan_settings=vxlan_settings) + try: + # Create a 'VnicEthAdapter.Policy' resource. + api_response = api_instance.create_vnic_eth_adapter_policy(vnic_eth_adapter_policy) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling VnicApi->create_vnic_eth_adapter_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of ethernet adapter policy + create_ethernet_adapter_policy() diff --git a/policies/ucs_server_policies/network/ethernet_adapter_policy/readme.md b/policies/ucs_server_policies/network/ethernet_adapter_policy/readme.md new file mode 100644 index 0000000..86137a8 --- /dev/null +++ b/policies/ucs_server_policies/network/ethernet_adapter_policy/readme.md @@ -0,0 +1,6 @@ +## Ethernet Adapter Policy +Governs the host-side behavior of the adapter, including how the adapter handles traffic. For each VIC Virtual Ethernet Interface, you can configure various features like VXLAN, NVGRE, ARFS, Interrupt settings, and TCP Offload settings. + +This policy includes the recommended default configurations for the supported server operating systems. The policy supports 16 default configurations. During the policy creation, you can select and import a default configuration. + + diff --git a/ucs_server/network/ethernet_adapter_policy/terraform/ethernet_adapter_policy.tf b/policies/ucs_server_policies/network/ethernet_adapter_policy/terraform/ethernet_adapter_policy.tf similarity index 100% rename from ucs_server/network/ethernet_adapter_policy/terraform/ethernet_adapter_policy.tf rename to policies/ucs_server_policies/network/ethernet_adapter_policy/terraform/ethernet_adapter_policy.tf diff --git a/ucs_server/network/ethernet_network_control_policy/ansible/ethernet_network_control_policy.yaml b/policies/ucs_server_policies/network/ethernet_network_control_policy/ansible/ethernet_network_control_policy.yaml similarity index 100% rename from ucs_server/network/ethernet_network_control_policy/ansible/ethernet_network_control_policy.yaml rename to policies/ucs_server_policies/network/ethernet_network_control_policy/ansible/ethernet_network_control_policy.yaml diff --git a/ucs_server/network/ethernet_network_control_policy/openapi/ethernet_network_control_policy.json b/policies/ucs_server_policies/network/ethernet_network_control_policy/openapi/ethernet_network_control_policy.json similarity index 100% rename from ucs_server/network/ethernet_network_control_policy/openapi/ethernet_network_control_policy.json rename to policies/ucs_server_policies/network/ethernet_network_control_policy/openapi/ethernet_network_control_policy.json diff --git a/ucs_server/network/ethernet_network_control_policy/powershell/ethernet_network_control_policy.ps1 b/policies/ucs_server_policies/network/ethernet_network_control_policy/powershell/ethernet_network_control_policy.ps1 similarity index 100% rename from ucs_server/network/ethernet_network_control_policy/powershell/ethernet_network_control_policy.ps1 rename to policies/ucs_server_policies/network/ethernet_network_control_policy/powershell/ethernet_network_control_policy.ps1 diff --git a/policies/ucs_server_policies/network/ethernet_network_control_policy/python/ethernet_network_control_policy.py b/policies/ucs_server_policies/network/ethernet_network_control_policy/python/ethernet_network_control_policy.py new file mode 100644 index 0000000..cf18721 --- /dev/null +++ b/policies/ucs_server_policies/network/ethernet_network_control_policy/python/ethernet_network_control_policy.py @@ -0,0 +1,50 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import fabric_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.fabric_eth_network_control_policy import FabricEthNetworkControlPolicy +from intersight.model.fabric_lldp_settings import FabricLldpSettings + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + + +def create_network_control_policy(): + # Create an instance of the API class. + api_instance = fabric_api.FabricApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create instance of FabricLldpSettings + lldp_settings = FabricLldpSettings(receive_enabled=True, transmit_enabled=True) + + # FabricEthNetworkControlPolicy | The 'FabricEthNetworkControl.Policy' resource to create. + fabric_eth_network_control_policy = FabricEthNetworkControlPolicy(name="sample_eth_network_control_policy_1", + organization=organization, + forge_mac="allow", + mac_registration_mode="nativeVlanOnly", + cdp_enabled=True, + uplink_fail_action="linkDown", + lldp_settings=lldp_settings) + try: + # Create a 'FabricEthNetworkControl.Policy' resource. + api_response = api_instance.create_fabric_eth_network_control_policy(fabric_eth_network_control_policy) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling FabricApi->create_fabric_eth_network_control_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of ethernet adapter policy + create_network_control_policy() \ No newline at end of file diff --git a/policies/ucs_server_policies/network/ethernet_network_control_policy/readme.md b/policies/ucs_server_policies/network/ethernet_network_control_policy/readme.md new file mode 100644 index 0000000..05630c1 --- /dev/null +++ b/policies/ucs_server_policies/network/ethernet_network_control_policy/readme.md @@ -0,0 +1,2 @@ +## Ethernet Network Control Policy +Configures the network control settings for the appliance ports, port channels, or vNICs. diff --git a/ucs_server/network/ethernet_network_control_policy/terraform/ethernet_network_control_policy.tf b/policies/ucs_server_policies/network/ethernet_network_control_policy/terraform/ethernet_network_control_policy.tf similarity index 100% rename from ucs_server/network/ethernet_network_control_policy/terraform/ethernet_network_control_policy.tf rename to policies/ucs_server_policies/network/ethernet_network_control_policy/terraform/ethernet_network_control_policy.tf diff --git a/ucs_server/network/ethernet_network_group_policy/ansible/ethernet_network_group_policy.yaml b/policies/ucs_server_policies/network/ethernet_network_group_policy/ansible/ethernet_network_group_policy.yaml similarity index 100% rename from ucs_server/network/ethernet_network_group_policy/ansible/ethernet_network_group_policy.yaml rename to policies/ucs_server_policies/network/ethernet_network_group_policy/ansible/ethernet_network_group_policy.yaml diff --git a/ucs_server/network/ethernet_network_group_policy/openapi/ethernet_network_group_policy.json b/policies/ucs_server_policies/network/ethernet_network_group_policy/openapi/ethernet_network_group_policy.json similarity index 100% rename from ucs_server/network/ethernet_network_group_policy/openapi/ethernet_network_group_policy.json rename to policies/ucs_server_policies/network/ethernet_network_group_policy/openapi/ethernet_network_group_policy.json diff --git a/ucs_server/network/ethernet_network_group_policy/powershell/ethernet_network_group_policy.ps1 b/policies/ucs_server_policies/network/ethernet_network_group_policy/powershell/ethernet_network_group_policy.ps1 similarity index 100% rename from ucs_server/network/ethernet_network_group_policy/powershell/ethernet_network_group_policy.ps1 rename to policies/ucs_server_policies/network/ethernet_network_group_policy/powershell/ethernet_network_group_policy.ps1 diff --git a/policies/ucs_server_policies/network/ethernet_network_group_policy/python/ethernet_network_group_policy.py b/policies/ucs_server_policies/network/ethernet_network_group_policy/python/ethernet_network_group_policy.py new file mode 100644 index 0000000..23e5cf2 --- /dev/null +++ b/policies/ucs_server_policies/network/ethernet_network_group_policy/python/ethernet_network_group_policy.py @@ -0,0 +1,44 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import fabric_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.fabric_eth_network_group_policy import FabricEthNetworkGroupPolicy +from intersight.model.fabric_vlan_settings import FabricVlanSettings + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_ethernet_network_group_policy(): + # Create an instance of the API class. + api_instance = fabric_api.FabricApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create instance of FabricVlanSettings + vlan_settings = FabricVlanSettings(native_vlan=1, allowed_vlans="11,12,13") + + # FabricEthNetworkGroupPolicy | The 'FabricEthNetworkGroup.Policy' resource to create. + fabric_eth_network_group_policy = FabricEthNetworkGroupPolicy(name="sample_fabricEthNetorkPolicy", + organization=organization, + vlan_settings=vlan_settings) + try: + # Create a 'FabricEthNetworkGroup.Policy' resource. + api_response = api_instance.create_fabric_eth_network_group_policy(fabric_eth_network_group_policy) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling FabricApi->create_fabric_eth_network_group_policy: %s\n" % e) + sys.exit(1) + +if __name__ == "__main__": + # Trigger creation of ethernet network group policy + create_ethernet_network_group_policy() \ No newline at end of file diff --git a/policies/ucs_server_policies/network/ethernet_network_group_policy/readme.md b/policies/ucs_server_policies/network/ethernet_network_group_policy/readme.md new file mode 100644 index 0000000..8bf9dfb --- /dev/null +++ b/policies/ucs_server_policies/network/ethernet_network_group_policy/readme.md @@ -0,0 +1,3 @@ +## Ethernet Network Group Policy +Configures the allowed VLAN and native VLAN for the appliance ports, port channels, or vNICs. + diff --git a/ucs_server/network/ethernet_network_group_policy/terraform/ethernet_network_group_policy.tf b/policies/ucs_server_policies/network/ethernet_network_group_policy/terraform/ethernet_network_group_policy.tf similarity index 100% rename from ucs_server/network/ethernet_network_group_policy/terraform/ethernet_network_group_policy.tf rename to policies/ucs_server_policies/network/ethernet_network_group_policy/terraform/ethernet_network_group_policy.tf diff --git a/ucs_server/network/ethernet_network_policy/ansible/ethernet_network_policy.yaml b/policies/ucs_server_policies/network/ethernet_network_policy/ansible/ethernet_network_policy.yaml similarity index 100% rename from ucs_server/network/ethernet_network_policy/ansible/ethernet_network_policy.yaml rename to policies/ucs_server_policies/network/ethernet_network_policy/ansible/ethernet_network_policy.yaml diff --git a/ucs_server/network/ethernet_network_policy/openapi/ethernet_network_policy.json b/policies/ucs_server_policies/network/ethernet_network_policy/openapi/ethernet_network_policy.json similarity index 100% rename from ucs_server/network/ethernet_network_policy/openapi/ethernet_network_policy.json rename to policies/ucs_server_policies/network/ethernet_network_policy/openapi/ethernet_network_policy.json diff --git a/ucs_server/network/ethernet_network_policy/powershell/ethernet_network_policy.ps1 b/policies/ucs_server_policies/network/ethernet_network_policy/powershell/ethernet_network_policy.ps1 similarity index 100% rename from ucs_server/network/ethernet_network_policy/powershell/ethernet_network_policy.ps1 rename to policies/ucs_server_policies/network/ethernet_network_policy/powershell/ethernet_network_policy.ps1 diff --git a/ucs_server/network/ethernet_network_policy/python/ethernet_network_policy.py b/policies/ucs_server_policies/network/ethernet_network_policy/python/ethernet_network_policy.py similarity index 51% rename from ucs_server/network/ethernet_network_policy/python/ethernet_network_policy.py rename to policies/ucs_server_policies/network/ethernet_network_policy/python/ethernet_network_policy.py index 15b95dd..880bee2 100644 --- a/ucs_server/network/ethernet_network_policy/python/ethernet_network_policy.py +++ b/policies/ucs_server_policies/network/ethernet_network_policy/python/ethernet_network_policy.py @@ -3,7 +3,9 @@ from authentication.python import intersight_authentication as client from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.vnic_eth_network_policy import VnicEthNetworkPolicy +from intersight.model.vnic_vlan_settings import VnicVlanSettings api_key = "api_key" api_key_file = "~/api_key_file_path" @@ -11,11 +13,24 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_ethernet_network_policy(): # Create an instance of the API class. api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create instance of VnicVlanSettings + vlan_settings = VnicVlanSettings(default_vlan=1, mode="TRUNK",allowed_vlans="11,12,13") # VnicEthNetworkPolicy | The 'VnicEthNetwork.Policy' resource to create. - vnic_eth_qos = VnicEthNetworkPolicy(name="sample_ethernet_network_policy") + vnic_eth_qos = VnicEthNetworkPolicy(name="sample_ethernet_network_policy", + organization=organization, + target_platform="Standalone", + vlan_settings=vlan_settings) try: # Create a 'VnicEthNetwork.Policy' resource. api_response = api_instance.create_vnic_eth_network_policy(vnic_eth_qos) diff --git a/policies/ucs_server_policies/network/ethernet_network_policy/readme.md b/policies/ucs_server_policies/network/ethernet_network_policy/readme.md new file mode 100644 index 0000000..3aa126f --- /dev/null +++ b/policies/ucs_server_policies/network/ethernet_network_policy/readme.md @@ -0,0 +1,2 @@ +## EthernetNetworkPolicy +Determines if the port can carry single VLAN(Access) or multiple VLANs(Trunk) traffic. You can specify the VLAN to be associated with an Ethernet packet if no tag is found. diff --git a/ucs_server/network/ethernet_network_policy/terraform/ethernet_network_policy.tf b/policies/ucs_server_policies/network/ethernet_network_policy/terraform/ethernet_network_policy.tf similarity index 100% rename from ucs_server/network/ethernet_network_policy/terraform/ethernet_network_policy.tf rename to policies/ucs_server_policies/network/ethernet_network_policy/terraform/ethernet_network_policy.tf diff --git a/ucs_server/network/ethernet_qos_policy/ansible/ethernet_qos_policy.yaml b/policies/ucs_server_policies/network/ethernet_qos_policy/ansible/ethernet_qos_policy.yaml similarity index 100% rename from ucs_server/network/ethernet_qos_policy/ansible/ethernet_qos_policy.yaml rename to policies/ucs_server_policies/network/ethernet_qos_policy/ansible/ethernet_qos_policy.yaml diff --git a/ucs_server/network/ethernet_qos_policy/openapi/ethernet_qos_policy.json b/policies/ucs_server_policies/network/ethernet_qos_policy/openapi/ethernet_qos_policy.json similarity index 100% rename from ucs_server/network/ethernet_qos_policy/openapi/ethernet_qos_policy.json rename to policies/ucs_server_policies/network/ethernet_qos_policy/openapi/ethernet_qos_policy.json diff --git a/ucs_server/network/ethernet_qos_policy/powershell/ethernet_qos_policy.ps1 b/policies/ucs_server_policies/network/ethernet_qos_policy/powershell/ethernet_qos_policy.ps1 similarity index 100% rename from ucs_server/network/ethernet_qos_policy/powershell/ethernet_qos_policy.ps1 rename to policies/ucs_server_policies/network/ethernet_qos_policy/powershell/ethernet_qos_policy.ps1 diff --git a/ucs_server/network/ethernet_qos_policy/python/ethernet_qos_policy.py b/policies/ucs_server_policies/network/ethernet_qos_policy/python/ethernet_qos_policy.py similarity index 54% rename from ucs_server/network/ethernet_qos_policy/python/ethernet_qos_policy.py rename to policies/ucs_server_policies/network/ethernet_qos_policy/python/ethernet_qos_policy.py index 8973e19..8e2c4fb 100644 --- a/ucs_server/network/ethernet_qos_policy/python/ethernet_qos_policy.py +++ b/policies/ucs_server_policies/network/ethernet_qos_policy/python/ethernet_qos_policy.py @@ -3,6 +3,7 @@ from authentication.python import intersight_authentication as client from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.vnic_eth_qos_policy import VnicEthQosPolicy @@ -12,11 +13,24 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_ethernet_qos_policy(): # Create an instance of the API class. api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() # VnicEthQosPolicy | The 'VnicEthQos.Policy' resource to create. - vnic_eth_qos = VnicEthQosPolicy(name="sample_ethernet_qos_policy") + vnic_eth_qos = VnicEthQosPolicy(name="sample_ethernet_qos_policy", + organization=organization, + priority="Best Effort", + burst=1024, + mtu=1500, + trust_host_cos=True) try: # Create a 'VnicEthQos.Policy' resource. api_response = api_instance.create_vnic_eth_qos_policy(vnic_eth_qos) diff --git a/policies/ucs_server_policies/network/ethernet_qos_policy/readme.md b/policies/ucs_server_policies/network/ethernet_qos_policy/readme.md new file mode 100644 index 0000000..08adc7a --- /dev/null +++ b/policies/ucs_server_policies/network/ethernet_qos_policy/readme.md @@ -0,0 +1,2 @@ +## Ethernet QoS Policy +Assigns a system class to the outgoing traffic for a vNIC. This system class determines the quality of service for the outgoing traffic. For certain adapters, you can also specify additional controls like burst and rate on the outgoing traffic. diff --git a/ucs_server/network/ethernet_qos_policy/terraform/ethernet_qos_policy.tf b/policies/ucs_server_policies/network/ethernet_qos_policy/terraform/ethernet_qos_policy.tf similarity index 100% rename from ucs_server/network/ethernet_qos_policy/terraform/ethernet_qos_policy.tf rename to policies/ucs_server_policies/network/ethernet_qos_policy/terraform/ethernet_qos_policy.tf diff --git a/ucs_server/network/lan_connectivity_policy/ansible/lan_connectivity_policy.yaml b/policies/ucs_server_policies/network/lan_connectivity_policy/ansible/lan_connectivity_policy.yaml similarity index 100% rename from ucs_server/network/lan_connectivity_policy/ansible/lan_connectivity_policy.yaml rename to policies/ucs_server_policies/network/lan_connectivity_policy/ansible/lan_connectivity_policy.yaml diff --git a/ucs_server/network/lan_connectivity_policy/openapi/lan_connectivity_policy.json b/policies/ucs_server_policies/network/lan_connectivity_policy/openapi/lan_connectivity_policy.json similarity index 100% rename from ucs_server/network/lan_connectivity_policy/openapi/lan_connectivity_policy.json rename to policies/ucs_server_policies/network/lan_connectivity_policy/openapi/lan_connectivity_policy.json diff --git a/ucs_server/network/lan_connectivity_policy/powershell/lan_connectivity_policy.ps1 b/policies/ucs_server_policies/network/lan_connectivity_policy/powershell/lan_connectivity_policy.ps1 similarity index 100% rename from ucs_server/network/lan_connectivity_policy/powershell/lan_connectivity_policy.ps1 rename to policies/ucs_server_policies/network/lan_connectivity_policy/powershell/lan_connectivity_policy.ps1 diff --git a/policies/ucs_server_policies/network/lan_connectivity_policy/python/lan_connectivity_policy.py b/policies/ucs_server_policies/network/lan_connectivity_policy/python/lan_connectivity_policy.py new file mode 100644 index 0000000..47c3606 --- /dev/null +++ b/policies/ucs_server_policies/network/lan_connectivity_policy/python/lan_connectivity_policy.py @@ -0,0 +1,50 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.vnic_lan_connectivity_policy import VnicLanConnectivityPolicy +from intersight.model.vnic_eth_if_relationship import VnicEthIfRelationship + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_lan_connectivity_policy(): + # Create an instance of the API class. + api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Get references to VnicEthIf object + eth_if_ref1= VnicEthIfRelationship(class_id="mo.MoRef", object_type="vnic.EthIf", moid="moid_of_ethif") + eth_if_ref2= VnicEthIfRelationship(class_id="mo.MoRef", object_type="vnic.EthIf", moid="moid_of_ethif") + + # Create lan connectivity policy + vnic_lan_con_pol1 = VnicLanConnectivityPolicy(name="sample_lan_policy1", + organization=organization, + iqn_allocation_type="None", + placement_mode="custom", + target_platform="Standalone", + azure_qos_enabled=True, + eth_ifs=[eth_if_ref1, eth_if_ref2]) + try: + # Create a 'VnicLanConnectivity.Policy' resource. + api_response1 = api_instance.create_vnic_lan_connectivity_policy(vnic_lan_con_pol1) + print(api_response1) + except intersight.ApiException as e: + print("Exception when calling VnicApi->create_vnic_lan_connectivity_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of lan connectivity policy + create_lan_connectivity_policy() diff --git a/policies/ucs_server_policies/network/lan_connectivity_policy/readme.md b/policies/ucs_server_policies/network/lan_connectivity_policy/readme.md new file mode 100644 index 0000000..a11cc9e --- /dev/null +++ b/policies/ucs_server_policies/network/lan_connectivity_policy/readme.md @@ -0,0 +1,3 @@ +## LAN Connectivity Policy +Determines the connections and the network communication resources between the server and the LAN on the network. You must create the Ethernet Adapter, Ethernet QoS, and Ethernet Network policies as part of the LAN connectivity policy. For IMM servers, use a MAC pool, or static MAC addresses, to assign MAC addresses to servers and to identify the vNICs that the servers use to communicate with the network + diff --git a/ucs_server/network/lan_connectivity_policy/terraform/lan_connectivity_policy.tf b/policies/ucs_server_policies/network/lan_connectivity_policy/terraform/lan_connectivity_policy.tf similarity index 100% rename from ucs_server/network/lan_connectivity_policy/terraform/lan_connectivity_policy.tf rename to policies/ucs_server_policies/network/lan_connectivity_policy/terraform/lan_connectivity_policy.tf diff --git a/ucs_server/network/netwrok_connectivity_policy/ansible/netwrok_connectivity_policy.yaml b/policies/ucs_server_policies/network/netwrok_connectivity_policy/ansible/netwrok_connectivity_policy.yaml similarity index 100% rename from ucs_server/network/netwrok_connectivity_policy/ansible/netwrok_connectivity_policy.yaml rename to policies/ucs_server_policies/network/netwrok_connectivity_policy/ansible/netwrok_connectivity_policy.yaml diff --git a/ucs_server/network/netwrok_connectivity_policy/openapi/netwrok_connectivity_policy.json b/policies/ucs_server_policies/network/netwrok_connectivity_policy/openapi/netwrok_connectivity_policy.json similarity index 100% rename from ucs_server/network/netwrok_connectivity_policy/openapi/netwrok_connectivity_policy.json rename to policies/ucs_server_policies/network/netwrok_connectivity_policy/openapi/netwrok_connectivity_policy.json diff --git a/ucs_server/network/netwrok_connectivity_policy/powershell/netwrok_connectivity_policy.ps1 b/policies/ucs_server_policies/network/netwrok_connectivity_policy/powershell/netwrok_connectivity_policy.ps1 similarity index 100% rename from ucs_server/network/netwrok_connectivity_policy/powershell/netwrok_connectivity_policy.ps1 rename to policies/ucs_server_policies/network/netwrok_connectivity_policy/powershell/netwrok_connectivity_policy.ps1 diff --git a/policies/ucs_server_policies/network/netwrok_connectivity_policy/python/netwrok_connectivity_policy.py b/policies/ucs_server_policies/network/netwrok_connectivity_policy/python/netwrok_connectivity_policy.py new file mode 100644 index 0000000..dc7913e --- /dev/null +++ b/policies/ucs_server_policies/network/netwrok_connectivity_policy/python/netwrok_connectivity_policy.py @@ -0,0 +1,46 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import networkconfig_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.networkconfig_policy import NetworkconfigPolicy + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_network_connectivity_policy(): + # Create an instance of the API class. + api_instance = networkconfig_api.NetworkconfigApi(api_client) + # Create an instance of organization. + organization = create_organization() + # NetworkconfigPolicy | The 'Networkconfig.Policy' resource to create. + vnic_lan_cnn_pol1 = NetworkconfigPolicy(name="sample_network_config_policy", + description="test network config policy", + organization=organization, + enable_dynamic_dns=True, + dynamic_dns_domain="xyz.com", + enable_ipv6=False, + alternate_ipv4dns_server="22.22.22.22", + preferred_ipv4dns_server="171.70.98.1",) + try: + # Create a 'Networkconfig.Policy' resource. + api_response1 = api_instance.create_networkconfig_policy(vnic_lan_cnn_pol1) + print(api_response1) + except intersight.ApiException as e: + print("Exception when calling networkconfig_api->create_networkconfig_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of network config policy + create_network_connectivity_policy() diff --git a/policies/ucs_server_policies/network/netwrok_connectivity_policy/readme.md b/policies/ucs_server_policies/network/netwrok_connectivity_policy/readme.md new file mode 100644 index 0000000..c2003e5 --- /dev/null +++ b/policies/ucs_server_policies/network/netwrok_connectivity_policy/readme.md @@ -0,0 +1,2 @@ +## Network Connectivity Policy +Specifies the DNS Domain settings that are used to add or update the resource records on the DNS server from the endpoints, and the DNS server settings for IPv4 and IPv6 on an endpoint. diff --git a/ucs_server/network/netwrok_connectivity_policy/terraform/netwrok_connectivity_policy.tf b/policies/ucs_server_policies/network/netwrok_connectivity_policy/terraform/netwrok_connectivity_policy.tf similarity index 100% rename from ucs_server/network/netwrok_connectivity_policy/terraform/netwrok_connectivity_policy.tf rename to policies/ucs_server_policies/network/netwrok_connectivity_policy/terraform/netwrok_connectivity_policy.tf diff --git a/ucs_server/network/san_connectivity_policy/ansible/san_connectivity_policy.yaml b/policies/ucs_server_policies/network/san_connectivity_policy/ansible/san_connectivity_policy.yaml similarity index 100% rename from ucs_server/network/san_connectivity_policy/ansible/san_connectivity_policy.yaml rename to policies/ucs_server_policies/network/san_connectivity_policy/ansible/san_connectivity_policy.yaml diff --git a/ucs_server/network/san_connectivity_policy/openapi/san_connectivity_policy.json b/policies/ucs_server_policies/network/san_connectivity_policy/openapi/san_connectivity_policy.json similarity index 100% rename from ucs_server/network/san_connectivity_policy/openapi/san_connectivity_policy.json rename to policies/ucs_server_policies/network/san_connectivity_policy/openapi/san_connectivity_policy.json diff --git a/ucs_server/network/san_connectivity_policy/powershell/san_connectivity_policy.ps1 b/policies/ucs_server_policies/network/san_connectivity_policy/powershell/san_connectivity_policy.ps1 similarity index 100% rename from ucs_server/network/san_connectivity_policy/powershell/san_connectivity_policy.ps1 rename to policies/ucs_server_policies/network/san_connectivity_policy/powershell/san_connectivity_policy.ps1 diff --git a/ucs_server/network/san_connectivity_policy/python/san_connectivity_policy.py b/policies/ucs_server_policies/network/san_connectivity_policy/python/san_connectivity_policy.py similarity index 55% rename from ucs_server/network/san_connectivity_policy/python/san_connectivity_policy.py rename to policies/ucs_server_policies/network/san_connectivity_policy/python/san_connectivity_policy.py index 781043c..fa046ce 100644 --- a/ucs_server/network/san_connectivity_policy/python/san_connectivity_policy.py +++ b/policies/ucs_server_policies/network/san_connectivity_policy/python/san_connectivity_policy.py @@ -3,6 +3,7 @@ from authentication.python import intersight_authentication as client from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.vnic_san_connectivity_policy import VnicSanConnectivityPolicy api_key = "api_key" @@ -11,11 +12,23 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_san_connectivity_policy(): # Create an instance of the API class. api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() # VnicSanConnectivityPolicy | The 'VnicSanConnectivity.Policy' resource to create. - vnic_san_cnn_pol1 = VnicSanConnectivityPolicy(name="sample_san_connectivity_policy") + vnic_san_cnn_pol1 = VnicSanConnectivityPolicy(name="sample_san_connectivity_policy", + organization=organization, + placement_mode="custom", + target_platform="Standalone", + wwnn_address_type="POOL") try: # Create a 'VnicSanConnectivity.Policy' resource. api_response1 = api_instance.create_vnic_san_connectivity_policy(vnic_san_cnn_pol1) diff --git a/policies/ucs_server_policies/network/san_connectivity_policy/readme.md b/policies/ucs_server_policies/network/san_connectivity_policy/readme.md new file mode 100644 index 0000000..ab8f245 --- /dev/null +++ b/policies/ucs_server_policies/network/san_connectivity_policy/readme.md @@ -0,0 +1,3 @@ +## SAN Connectivity Policy +Determines the network storage resources and the connections between the server and the SAN on the network. This policy enables you to configure vHBAs that the servers use to communicate with the Storage Area Network. You can use WWPN and WWNN address pools, or static WWPN and WWNN addresses, to add vHBAs and to configure them. You must create the Fibre Channel Adapter, Fibre Channel QoS, and Fibre Channel Network policies as part of the SAN connectivity policy. + diff --git a/ucs_server/network/san_connectivity_policy/terraform/san_connectivity_policy.tf b/policies/ucs_server_policies/network/san_connectivity_policy/terraform/san_connectivity_policy.tf similarity index 100% rename from ucs_server/network/san_connectivity_policy/terraform/san_connectivity_policy.tf rename to policies/ucs_server_policies/network/san_connectivity_policy/terraform/san_connectivity_policy.tf diff --git a/ucs_server/storage/device_connector_policy/ansible/device_connector_policy.yaml b/policies/ucs_server_policies/storage/device_connector_policy/ansible/device_connector_policy.yaml similarity index 100% rename from ucs_server/storage/device_connector_policy/ansible/device_connector_policy.yaml rename to policies/ucs_server_policies/storage/device_connector_policy/ansible/device_connector_policy.yaml diff --git a/ucs_server/storage/device_connector_policy/openapi/device_connector_policy.json b/policies/ucs_server_policies/storage/device_connector_policy/openapi/device_connector_policy.json similarity index 100% rename from ucs_server/storage/device_connector_policy/openapi/device_connector_policy.json rename to policies/ucs_server_policies/storage/device_connector_policy/openapi/device_connector_policy.json diff --git a/ucs_server/storage/device_connector_policy/powershell/device_connector_policy.ps1 b/policies/ucs_server_policies/storage/device_connector_policy/powershell/device_connector_policy.ps1 similarity index 100% rename from ucs_server/storage/device_connector_policy/powershell/device_connector_policy.ps1 rename to policies/ucs_server_policies/storage/device_connector_policy/powershell/device_connector_policy.ps1 diff --git a/ucs_server/storage/device_connector_policy/python/device_connector_policy.py b/policies/ucs_server_policies/storage/device_connector_policy/python/device_connector_policy.py similarity index 56% rename from ucs_server/storage/device_connector_policy/python/device_connector_policy.py rename to policies/ucs_server_policies/storage/device_connector_policy/python/device_connector_policy.py index 34e2a38..465230e 100644 --- a/ucs_server/storage/device_connector_policy/python/device_connector_policy.py +++ b/policies/ucs_server_policies/storage/device_connector_policy/python/device_connector_policy.py @@ -3,6 +3,7 @@ from authentication.python import intersight_authentication as client from intersight.api import deviceconnector_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.deviceconnector_policy import DeviceconnectorPolicy api_key = "api_key" @@ -11,9 +12,19 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_device_connector_policy(): api_instance = deviceconnector_api.DeviceconnectorApi(api_client) - dev_conn_pol = DeviceconnectorPolicy(name="sample_device_connector_policy") + # Create an instance of organization. + organization = create_organization() + dev_conn_pol = DeviceconnectorPolicy(name="sample_device_connector_policy", + lockout_enabled=True, + organization=organization) try: api_response = api_instance.create_deviceconnector_policy(dev_conn_pol) print(api_response) diff --git a/ucs_server/storage/device_connector_policy/readme.md b/policies/ucs_server_policies/storage/device_connector_policy/readme.md similarity index 55% rename from ucs_server/storage/device_connector_policy/readme.md rename to policies/ucs_server_policies/storage/device_connector_policy/readme.md index 18127ad..4769ac1 100644 --- a/ucs_server/storage/device_connector_policy/readme.md +++ b/policies/ucs_server_policies/storage/device_connector_policy/readme.md @@ -12,11 +12,4 @@ Lets you choose the Configuration from Intersight only option to control configu IPMI over LAN privileges will be reset to read-only level if Configuration from Intersight only is enabled through the Device Connector policy, or if the same configuration is enabled in the Device Connector in Cisco IMC. Attention: The Device Connector Policy will not be imported as part of the Server Profile Import. -## Device Connector Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Device Connector Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/deviceconnector_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Device Connector Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/deviceconnector_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Device Connector Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightDeviceconnectorPolicy.md) properties reference - diff --git a/ucs_server/storage/device_connector_policy/terraform/device_connector_policy.tf b/policies/ucs_server_policies/storage/device_connector_policy/terraform/device_connector_policy.tf similarity index 100% rename from ucs_server/storage/device_connector_policy/terraform/device_connector_policy.tf rename to policies/ucs_server_policies/storage/device_connector_policy/terraform/device_connector_policy.tf diff --git a/ucs_server/storage/fiber_channel_adapter_policy/ansible/fiber_channel_adapter_policy.yaml b/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/ansible/fiber_channel_adapter_policy.yaml similarity index 100% rename from ucs_server/storage/fiber_channel_adapter_policy/ansible/fiber_channel_adapter_policy.yaml rename to policies/ucs_server_policies/storage/fiber_channel_adapter_policy/ansible/fiber_channel_adapter_policy.yaml diff --git a/ucs_server/storage/fiber_channel_adapter_policy/openapi/fiber_channel_adapter_policy.json b/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/openapi/fiber_channel_adapter_policy.json similarity index 100% rename from ucs_server/storage/fiber_channel_adapter_policy/openapi/fiber_channel_adapter_policy.json rename to policies/ucs_server_policies/storage/fiber_channel_adapter_policy/openapi/fiber_channel_adapter_policy.json diff --git a/ucs_server/storage/fiber_channel_adapter_policy/powershell/fiber_channel_adapter_policy.ps1 b/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/powershell/fiber_channel_adapter_policy.ps1 similarity index 100% rename from ucs_server/storage/fiber_channel_adapter_policy/powershell/fiber_channel_adapter_policy.ps1 rename to policies/ucs_server_policies/storage/fiber_channel_adapter_policy/powershell/fiber_channel_adapter_policy.ps1 diff --git a/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/python/fiber_channel_adapter_policy.py b/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/python/fiber_channel_adapter_policy.py new file mode 100644 index 0000000..796cbbe --- /dev/null +++ b/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/python/fiber_channel_adapter_policy.py @@ -0,0 +1,75 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.vnic_fc_adapter_policy import VnicFcAdapterPolicy +from intersight.model.vnic_fc_error_recovery_settings import VnicFcErrorRecoverySettings +from intersight.model.vnic_flogi_settings import VnicFlogiSettings +from intersight.model.vnic_fc_interrupt_settings import VnicFcInterruptSettings +from intersight.model.vnic_plogi_settings import VnicPlogiSettings +from intersight.model.vnic_fc_queue_settings import VnicFcQueueSettings +from intersight.model.vnic_scsi_queue_settings import VnicScsiQueueSettings +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_fiber_channel_adapter_policy(): + # Create an instance of the API class. + api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create an instance of VnicFcErrorRecoverySettings + error_recovery_settings = VnicFcErrorRecoverySettings(enabled=True, + io_retry_count=8, + io_retry_timeout=5, + link_down_timeout=3000, + port_down_timeout=5000) + # Create an instance of VnicFlogiSettings + flogi_settings = VnicFlogiSettings(retries=0, timeout=4000) + # Create an instance of VnicFcInterruptSettings + interrupt_settings = VnicFcInterruptSettings(mode="INTx") + # Create instance of VnicPlogiSettings + plogi_settings = VnicPlogiSettings(retries=8, timeout=3000) + # Create an instance of VnicFcQueueSettings + rx_queue_settings = VnicFcQueueSettings(ring_size=64) + # Create an instance of VnicScsiQueueSettings + scsi_queue_settings = VnicScsiQueueSettings(count=1, ring_size=64) + # Create an instance of VnicFcQueueSettings + tx_queue_settings = VnicFcQueueSettings(ring_size=64) + # VnicFcAdapterPolicy | The 'VnicFcAdapter.Policy' resource to create. + fc_adap_pol = VnicFcAdapterPolicy(name="sample_fiber_channel_adapter_policy", + organization=organization, + error_detection_timeout=2000, + io_throttle_count=512, + lun_count=1024, + lun_queue_depth=20, + resource_allocation_timeout=10000, + error_recovery_settings=error_recovery_settings, + flogi_settings=flogi_settings, + interrupt_settings=interrupt_settings, + plogi_settings=plogi_settings, + rx_queue_settings=rx_queue_settings, + scsi_queue_settings=scsi_queue_settings, + tx_queue_settings=tx_queue_settings) + try: + # Create a 'VnicFcAdapter.Policy' resource. + api_response = api_instance.create_vnic_fc_adapter_policy(fc_adap_pol) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling VnicApi->create_vnic_fc_adapter_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of fiber channel adapter policy + create_fiber_channel_adapter_policy() diff --git a/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/readme.md b/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/readme.md new file mode 100644 index 0000000..872bf9c --- /dev/null +++ b/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/readme.md @@ -0,0 +1,5 @@ +## Fiber Channel Adapter Policy +Governs the host-side behavior of the adapter, including how the adapter handles traffic. You can enable FCP Error Recovery, change the default settings of Queues, and Interrupt handling for performance enhancement. + +This policy includes the recommended default configurations for the supported server operating systems. The policy supports nine default configurations. During the policy creation, you can select and import a default configuration. + diff --git a/ucs_server/storage/fiber_channel_adapter_policy/terraform/fiber_channel_adapter_policy.tf b/policies/ucs_server_policies/storage/fiber_channel_adapter_policy/terraform/fiber_channel_adapter_policy.tf similarity index 100% rename from ucs_server/storage/fiber_channel_adapter_policy/terraform/fiber_channel_adapter_policy.tf rename to policies/ucs_server_policies/storage/fiber_channel_adapter_policy/terraform/fiber_channel_adapter_policy.tf diff --git a/ucs_server/storage/fiber_channel_network_policy/ansible/fiber_channel_network_policy.yaml b/policies/ucs_server_policies/storage/fiber_channel_network_policy/ansible/fiber_channel_network_policy.yaml similarity index 100% rename from ucs_server/storage/fiber_channel_network_policy/ansible/fiber_channel_network_policy.yaml rename to policies/ucs_server_policies/storage/fiber_channel_network_policy/ansible/fiber_channel_network_policy.yaml diff --git a/ucs_server/storage/fiber_channel_network_policy/openapi/fiber_channel_network_policy.json b/policies/ucs_server_policies/storage/fiber_channel_network_policy/openapi/fiber_channel_network_policy.json similarity index 100% rename from ucs_server/storage/fiber_channel_network_policy/openapi/fiber_channel_network_policy.json rename to policies/ucs_server_policies/storage/fiber_channel_network_policy/openapi/fiber_channel_network_policy.json diff --git a/ucs_server/storage/fiber_channel_network_policy/powershell/fiber_channel_network_policy.ps1 b/policies/ucs_server_policies/storage/fiber_channel_network_policy/powershell/fiber_channel_network_policy.ps1 similarity index 100% rename from ucs_server/storage/fiber_channel_network_policy/powershell/fiber_channel_network_policy.ps1 rename to policies/ucs_server_policies/storage/fiber_channel_network_policy/powershell/fiber_channel_network_policy.ps1 diff --git a/ucs_server/storage/fiber_channel_network_policy/python/fiber_channel_network_policy.py b/policies/ucs_server_policies/storage/fiber_channel_network_policy/python/fiber_channel_network_policy.py similarity index 54% rename from ucs_server/storage/fiber_channel_network_policy/python/fiber_channel_network_policy.py rename to policies/ucs_server_policies/storage/fiber_channel_network_policy/python/fiber_channel_network_policy.py index 5f74ce3..724056d 100644 --- a/ucs_server/storage/fiber_channel_network_policy/python/fiber_channel_network_policy.py +++ b/policies/ucs_server_policies/storage/fiber_channel_network_policy/python/fiber_channel_network_policy.py @@ -3,7 +3,9 @@ from authentication.python import intersight_authentication as client from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.vnic_fc_network_policy import VnicFcNetworkPolicy +from intersight.model.vnic_vsan_settings import VnicVsanSettings api_key = "api_key" api_key_file = "~/api_key_file_path" @@ -11,11 +13,23 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_fiber_channel_network_policy(): # Create an instance of the API class. api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create an instance of VnicVsanSettings + vsan_settings = VnicVsanSettings(id=22, default_vlan_id=22) # VnicFcNetworkPolicy | The 'VnicFcNetwork.Policy' resource to create. - fc_net_pol = VnicFcNetworkPolicy(name="sample_fiber_channel_network_policy") + fc_net_pol = VnicFcNetworkPolicy(name="sample_fiber_channel_network_policy", + organization=organization, + vsan_settings=vsan_settings) try: # Create a 'VnicFcNetwork.Policy' resource. api_response = api_instance.create_vnic_fc_network_policy(fc_net_pol) diff --git a/policies/ucs_server_policies/storage/fiber_channel_network_policy/readme.md b/policies/ucs_server_policies/storage/fiber_channel_network_policy/readme.md new file mode 100644 index 0000000..9b22757 --- /dev/null +++ b/policies/ucs_server_policies/storage/fiber_channel_network_policy/readme.md @@ -0,0 +1,2 @@ +## Fiber Channel Network Policy +Governs the VSAN configuration for the virtual interfaces. diff --git a/ucs_server/storage/fiber_channel_network_policy/terraform/fiber_channel_network_policy.tf b/policies/ucs_server_policies/storage/fiber_channel_network_policy/terraform/fiber_channel_network_policy.tf similarity index 100% rename from ucs_server/storage/fiber_channel_network_policy/terraform/fiber_channel_network_policy.tf rename to policies/ucs_server_policies/storage/fiber_channel_network_policy/terraform/fiber_channel_network_policy.tf diff --git a/ucs_server/storage/fiber_channel_qos_policy/ansible/fiber_channel_qos_policy.yaml b/policies/ucs_server_policies/storage/fiber_channel_qos_policy/ansible/fiber_channel_qos_policy.yaml similarity index 100% rename from ucs_server/storage/fiber_channel_qos_policy/ansible/fiber_channel_qos_policy.yaml rename to policies/ucs_server_policies/storage/fiber_channel_qos_policy/ansible/fiber_channel_qos_policy.yaml diff --git a/ucs_server/storage/fiber_channel_qos_policy/openapi/fiber_channel_qos_policy.json b/policies/ucs_server_policies/storage/fiber_channel_qos_policy/openapi/fiber_channel_qos_policy.json similarity index 100% rename from ucs_server/storage/fiber_channel_qos_policy/openapi/fiber_channel_qos_policy.json rename to policies/ucs_server_policies/storage/fiber_channel_qos_policy/openapi/fiber_channel_qos_policy.json diff --git a/ucs_server/storage/fiber_channel_qos_policy/powershell/fiber_channel_qos_policy.ps1 b/policies/ucs_server_policies/storage/fiber_channel_qos_policy/powershell/fiber_channel_qos_policy.ps1 similarity index 100% rename from ucs_server/storage/fiber_channel_qos_policy/powershell/fiber_channel_qos_policy.ps1 rename to policies/ucs_server_policies/storage/fiber_channel_qos_policy/powershell/fiber_channel_qos_policy.ps1 diff --git a/ucs_server/storage/fiber_channel_qos_policy/python/fiber_channel_qos_policy.py b/policies/ucs_server_policies/storage/fiber_channel_qos_policy/python/fiber_channel_qos_policy.py similarity index 55% rename from ucs_server/storage/fiber_channel_qos_policy/python/fiber_channel_qos_policy.py rename to policies/ucs_server_policies/storage/fiber_channel_qos_policy/python/fiber_channel_qos_policy.py index 37d7369..d7eda3b 100644 --- a/ucs_server/storage/fiber_channel_qos_policy/python/fiber_channel_qos_policy.py +++ b/policies/ucs_server_policies/storage/fiber_channel_qos_policy/python/fiber_channel_qos_policy.py @@ -3,6 +3,7 @@ from authentication.python import intersight_authentication as client from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.vnic_fc_qos_policy import VnicFcQosPolicy api_key = "api_key" @@ -11,11 +12,24 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_fiber_channel_qos_policy(): # Create an instance of the API class. api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() # VnicFcQosPolicy | The 'VnicFcQos.Policy' resource to create. - fc_qos_pol = VnicFcQosPolicy(name="sample_fiber_channel_qos_policy") + fc_qos_pol = VnicFcQosPolicy(name="sample_fiber_channel_qos_policy", + organization=organization, + burst=1024, + cos=3, + max_data_field_size=2112, + rate_limit=2048) try: # Create a 'VnicFcQos.Policy' resource. api_response = api_instance.create_vnic_fc_qos_policy(fc_qos_pol) diff --git a/policies/ucs_server_policies/storage/fiber_channel_qos_policy/readme.md b/policies/ucs_server_policies/storage/fiber_channel_qos_policy/readme.md new file mode 100644 index 0000000..fc161bf --- /dev/null +++ b/policies/ucs_server_policies/storage/fiber_channel_qos_policy/readme.md @@ -0,0 +1,2 @@ +## Fibre Channel QoS Policy +Assigns a system class to the outgoing traffic for a vHBA. This system class determines the quality of service for the outgoing traffic. For certain adapters, you can also specify additional controls like burst and rate on the outgoing traffic. diff --git a/ucs_server/storage/fiber_channel_qos_policy/terraform/fiber_channel_qos_policy.tf b/policies/ucs_server_policies/storage/fiber_channel_qos_policy/terraform/fiber_channel_qos_policy.tf similarity index 100% rename from ucs_server/storage/fiber_channel_qos_policy/terraform/fiber_channel_qos_policy.tf rename to policies/ucs_server_policies/storage/fiber_channel_qos_policy/terraform/fiber_channel_qos_policy.tf diff --git a/ucs_server/storage/iscsi_adapter_policy/ansible/iscsi_adapter_policy.yaml b/policies/ucs_server_policies/storage/iscsi_adapter_policy/ansible/iscsi_adapter_policy.yaml similarity index 100% rename from ucs_server/storage/iscsi_adapter_policy/ansible/iscsi_adapter_policy.yaml rename to policies/ucs_server_policies/storage/iscsi_adapter_policy/ansible/iscsi_adapter_policy.yaml diff --git a/ucs_server/storage/iscsi_adapter_policy/openapi/iscsi_adapter_policy.json b/policies/ucs_server_policies/storage/iscsi_adapter_policy/openapi/iscsi_adapter_policy.json similarity index 100% rename from ucs_server/storage/iscsi_adapter_policy/openapi/iscsi_adapter_policy.json rename to policies/ucs_server_policies/storage/iscsi_adapter_policy/openapi/iscsi_adapter_policy.json diff --git a/ucs_server/storage/iscsi_adapter_policy/powershell/iscsi_adapter_policy.ps1 b/policies/ucs_server_policies/storage/iscsi_adapter_policy/powershell/iscsi_adapter_policy.ps1 similarity index 100% rename from ucs_server/storage/iscsi_adapter_policy/powershell/iscsi_adapter_policy.ps1 rename to policies/ucs_server_policies/storage/iscsi_adapter_policy/powershell/iscsi_adapter_policy.ps1 diff --git a/ucs_server/storage/iscsi_adapter_policy/python/iscsi_adapter_policy.py b/policies/ucs_server_policies/storage/iscsi_adapter_policy/python/iscsi_adapter_policy.py similarity index 55% rename from ucs_server/storage/iscsi_adapter_policy/python/iscsi_adapter_policy.py rename to policies/ucs_server_policies/storage/iscsi_adapter_policy/python/iscsi_adapter_policy.py index f270ed5..daa8c4f 100644 --- a/ucs_server/storage/iscsi_adapter_policy/python/iscsi_adapter_policy.py +++ b/policies/ucs_server_policies/storage/iscsi_adapter_policy/python/iscsi_adapter_policy.py @@ -3,6 +3,7 @@ from authentication.python import intersight_authentication as client from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.vnic_iscsi_adapter_policy import VnicIscsiAdapterPolicy api_key = "api_key" @@ -11,11 +12,23 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_iscsi_adapter_policy(): # Create an instance of the API class. api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() # VnicIscsiAdapterPolicy | The 'VnicIscsiAdapter.Policy' resource to create. - iscsi_adapt_pol = VnicIscsiAdapterPolicy(name="sample_iscsi_adapter_policy", dhcp_timeout=90) + iscsi_adapt_pol = VnicIscsiAdapterPolicy(name="sample_iscsi_adapter_policy", + organization=organization, + connection_time_out=255, + dhcp_timeout=90, + lun_busy_retry_count=60) try: # Create a 'VnicIscsiAdapter.Policy' resource. api_response = api_instance.create_vnic_iscsi_adapter_policy(iscsi_adapt_pol) diff --git a/policies/ucs_server_policies/storage/iscsi_adapter_policy/readme.md b/policies/ucs_server_policies/storage/iscsi_adapter_policy/readme.md new file mode 100644 index 0000000..f0f5bc7 --- /dev/null +++ b/policies/ucs_server_policies/storage/iscsi_adapter_policy/readme.md @@ -0,0 +1,3 @@ +## Iscsi Adapter Policy +The iSCSI Adapter policy allows you to configure values for TCP Connection Timeout, DHCP Timeout, and the Retry Count if the specified LUN ID is busy. + diff --git a/ucs_server/storage/iscsi_adapter_policy/terraform/iscsi_adapter_policy.tf b/policies/ucs_server_policies/storage/iscsi_adapter_policy/terraform/iscsi_adapter_policy.tf similarity index 100% rename from ucs_server/storage/iscsi_adapter_policy/terraform/iscsi_adapter_policy.tf rename to policies/ucs_server_policies/storage/iscsi_adapter_policy/terraform/iscsi_adapter_policy.tf diff --git a/ucs_server/storage/iscsi_boot_policy/ansible/iscsi_boot_policy.yaml b/policies/ucs_server_policies/storage/iscsi_boot_policy/ansible/iscsi_boot_policy.yaml similarity index 100% rename from ucs_server/storage/iscsi_boot_policy/ansible/iscsi_boot_policy.yaml rename to policies/ucs_server_policies/storage/iscsi_boot_policy/ansible/iscsi_boot_policy.yaml diff --git a/ucs_server/storage/iscsi_boot_policy/openapi/iscsi_boot_policy.json b/policies/ucs_server_policies/storage/iscsi_boot_policy/openapi/iscsi_boot_policy.json similarity index 100% rename from ucs_server/storage/iscsi_boot_policy/openapi/iscsi_boot_policy.json rename to policies/ucs_server_policies/storage/iscsi_boot_policy/openapi/iscsi_boot_policy.json diff --git a/ucs_server/storage/iscsi_boot_policy/powershell/iscsi_boot_policy.ps1 b/policies/ucs_server_policies/storage/iscsi_boot_policy/powershell/iscsi_boot_policy.ps1 similarity index 100% rename from ucs_server/storage/iscsi_boot_policy/powershell/iscsi_boot_policy.ps1 rename to policies/ucs_server_policies/storage/iscsi_boot_policy/powershell/iscsi_boot_policy.ps1 diff --git a/ucs_server/storage/iscsi_boot_policy/python/iscsi_boot_policy.py b/policies/ucs_server_policies/storage/iscsi_boot_policy/python/iscsi_boot_policy.py similarity index 53% rename from ucs_server/storage/iscsi_boot_policy/python/iscsi_boot_policy.py rename to policies/ucs_server_policies/storage/iscsi_boot_policy/python/iscsi_boot_policy.py index aab59f8..0ca0745 100644 --- a/ucs_server/storage/iscsi_boot_policy/python/iscsi_boot_policy.py +++ b/policies/ucs_server_policies/storage/iscsi_boot_policy/python/iscsi_boot_policy.py @@ -3,10 +3,13 @@ from authentication.python import intersight_authentication as client from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.vnic_iscsi_boot_policy import VnicIscsiBootPolicy from intersight.model.vnic_iscsi_static_target_policy import VnicIscsiStaticTargetPolicy from intersight.model.vnic_iscsi_static_target_policy_relationship import VnicIscsiStaticTargetPolicyRelationship - +from intersight.model.vnic_iscsi_auth_profile import VnicIscsiAuthProfile +from intersight.model.ippool_ip_v4_config import IppoolIpV4Config +from intersight.model.vnic_iscsi_adapter_policy_relationship import VnicIscsiAdapterPolicyRelationship api_key = "api_key" api_key_file = "~/api_key_file_path" @@ -16,11 +19,22 @@ api_instance = vnic_api.VnicApi(api_client) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_vnic_iscsi_static_target_policy(): + # Create an instance of the API class. + api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() # VnicIscsiStaticTargetPolicy | The 'VnicIscsiStaticTarget.Policy' resource to create. iscsiStaticTargetPolicy = VnicIscsiStaticTargetPolicy() # Setting all the attributes for iscsiStaticTargetPolicy instance. iscsiStaticTargetPolicy.name = "staticTargetPolicytest2" + iscsiStaticTargetPolicy.organization = organization iscsiStaticTargetPolicy.ip_address = "25.25.25.25" iscsiStaticTargetPolicy.port = 650 iscsiStaticTargetPolicy.target_name = "iqn.2012-02.com.ibm.de.boeblingen:01:c5f446d488f4" @@ -41,9 +55,30 @@ def create_policy_reference(policy_moid, obj_type): def create_boot_policy(stat_pol_ref): + # Create an instance of the API class. + api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create an instance of VnicIscsiAuthProfile + chap = VnicIscsiAuthProfile(user_id="test", password="test@11234567") + mutual_chap = VnicIscsiAuthProfile(user_id="admin", password="test@11234567") + # Create an instance of IppoolIpV4Config + initiator_static_ip_v4_config = IppoolIpV4Config(gateway="172.16.2.1", netmask="255.255.255.0") + # Create an instance of VnicIscsiAdapterPolicy + iscsi_adapter_policy = VnicIscsiAdapterPolicyRelationship(class_id="mo.MoRef", + object_type="vnic.IscsiAdapterPolicy", + moid="moid_of_your_iscsci_adapter_policy") # VnicIscsiBootPolicy | The 'VnicIscsiBoot.Policy' resource to create. iscsi_boot_pol = VnicIscsiBootPolicy(name="sample_iscsi_boot_policy1") + iscsi_boot_pol.organization = organization + iscsi_boot_pol.initiator_ip_source = "Static" + iscsi_boot_pol.target_source_type = "Static" + iscsi_boot_pol.chap = chap + iscsi_boot_pol.initiator_static_ip_v4_address = "172.16.2.19" + iscsi_boot_pol.initiator_static_ip_v4_config = initiator_static_ip_v4_config + iscsi_boot_pol.iscsi_adapter_policy = iscsi_adapter_policy iscsi_boot_pol.primary_target_policy = stat_pol_ref + iscsi_boot_pol.mutual_chap = mutual_chap try: # Create a 'VnicIscsiBoot.Policy' resource. api_response = api_instance.create_vnic_iscsi_boot_policy(iscsi_boot_pol) diff --git a/policies/ucs_server_policies/storage/iscsi_boot_policy/readme.md b/policies/ucs_server_policies/storage/iscsi_boot_policy/readme.md new file mode 100644 index 0000000..ff38b22 --- /dev/null +++ b/policies/ucs_server_policies/storage/iscsi_boot_policy/readme.md @@ -0,0 +1,2 @@ +## Iscsi Boot Policy +iSCSI boot support allows you to initialize the Operating System on FI-attached blade and rack servers from a remote disk across a Storage Area Network. diff --git a/ucs_server/storage/iscsi_boot_policy/terraform/iscsi_boot_policy.tf b/policies/ucs_server_policies/storage/iscsi_boot_policy/terraform/iscsi_boot_policy.tf similarity index 100% rename from ucs_server/storage/iscsi_boot_policy/terraform/iscsi_boot_policy.tf rename to policies/ucs_server_policies/storage/iscsi_boot_policy/terraform/iscsi_boot_policy.tf diff --git a/ucs_server/storage/iscsi_static_target_policy/ansible/iscsi_static_target_policy.yaml b/policies/ucs_server_policies/storage/iscsi_static_target_policy/ansible/iscsi_static_target_policy.yaml similarity index 100% rename from ucs_server/storage/iscsi_static_target_policy/ansible/iscsi_static_target_policy.yaml rename to policies/ucs_server_policies/storage/iscsi_static_target_policy/ansible/iscsi_static_target_policy.yaml diff --git a/ucs_server/storage/iscsi_static_target_policy/openapi/iscsi_static_target_policy.json b/policies/ucs_server_policies/storage/iscsi_static_target_policy/openapi/iscsi_static_target_policy.json similarity index 100% rename from ucs_server/storage/iscsi_static_target_policy/openapi/iscsi_static_target_policy.json rename to policies/ucs_server_policies/storage/iscsi_static_target_policy/openapi/iscsi_static_target_policy.json diff --git a/ucs_server/storage/iscsi_static_target_policy/powershell/iscsi_static_target_policy.ps1 b/policies/ucs_server_policies/storage/iscsi_static_target_policy/powershell/iscsi_static_target_policy.ps1 similarity index 100% rename from ucs_server/storage/iscsi_static_target_policy/powershell/iscsi_static_target_policy.ps1 rename to policies/ucs_server_policies/storage/iscsi_static_target_policy/powershell/iscsi_static_target_policy.ps1 diff --git a/ucs_server/storage/iscsi_static_target_policy/python/iscsi_static_target_policy.py b/policies/ucs_server_policies/storage/iscsi_static_target_policy/python/iscsi_static_target_policy.py similarity index 65% rename from ucs_server/storage/iscsi_static_target_policy/python/iscsi_static_target_policy.py rename to policies/ucs_server_policies/storage/iscsi_static_target_policy/python/iscsi_static_target_policy.py index dda5c01..9f110a9 100644 --- a/ucs_server/storage/iscsi_static_target_policy/python/iscsi_static_target_policy.py +++ b/policies/ucs_server_policies/storage/iscsi_static_target_policy/python/iscsi_static_target_policy.py @@ -3,7 +3,9 @@ from authentication.python import intersight_authentication as client from intersight.api import vnic_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.vnic_iscsi_static_target_policy import VnicIscsiStaticTargetPolicy +from intersight.model.vnic_lun import VnicLun api_key = "api_key" api_key_file = "~/api_key_file_path" @@ -11,15 +13,27 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + def create_iscsi_static_target_policy(): # Create an instance of the API class. api_instance = vnic_api.VnicApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create instance of VnicLun + lun = VnicLun(bootable=True, lun_id=100) # VnicIscsiStaticTargetPolicy | The 'VnicIscsiStaticTarget.Policy' resource to create. iscsiStaticTargetPolicy = VnicIscsiStaticTargetPolicy() # Setting all the attributes for iscsiStaticTargetPolicy instance. iscsiStaticTargetPolicy.name = "sample_iscsi_static_target_policy" + iscsiStaticTargetPolicy.organization = organization iscsiStaticTargetPolicy.ip_address = "25.25.25.25" iscsiStaticTargetPolicy.port = 650 + iscsiStaticTargetPolicy.lun = lun iscsiStaticTargetPolicy.target_name = "iqn.2012-02.com.ibm.de.boeblingen:01:c5f446d488f4" try: # Create a 'VnicIscsiStaticTarget.Policy' resource. diff --git a/policies/ucs_server_policies/storage/iscsi_static_target_policy/readme.md b/policies/ucs_server_policies/storage/iscsi_static_target_policy/readme.md new file mode 100644 index 0000000..3abd2f5 --- /dev/null +++ b/policies/ucs_server_policies/storage/iscsi_static_target_policy/readme.md @@ -0,0 +1,2 @@ +## ISCSI Static Target Policy +he iSCSI Static Target policy allows you to specify the name, IP address, port, and logical unit number of the primary target for iSCSI boot. You can optionally specify these details for a secondary target as well. diff --git a/ucs_server/storage/iscsi_static_target_policy/terraform/iscsi_static_target_policy.tf b/policies/ucs_server_policies/storage/iscsi_static_target_policy/terraform/iscsi_static_target_policy.tf similarity index 100% rename from ucs_server/storage/iscsi_static_target_policy/terraform/iscsi_static_target_policy.tf rename to policies/ucs_server_policies/storage/iscsi_static_target_policy/terraform/iscsi_static_target_policy.tf diff --git a/ucs_server/storage/sd_card_policy/ansible/sd_card_policy.yaml b/policies/ucs_server_policies/storage/sd_card_policy/ansible/sd_card_policy.yaml similarity index 100% rename from ucs_server/storage/sd_card_policy/ansible/sd_card_policy.yaml rename to policies/ucs_server_policies/storage/sd_card_policy/ansible/sd_card_policy.yaml diff --git a/ucs_server/storage/sd_card_policy/openapi/sd_card_policy.json b/policies/ucs_server_policies/storage/sd_card_policy/openapi/sd_card_policy.json similarity index 100% rename from ucs_server/storage/sd_card_policy/openapi/sd_card_policy.json rename to policies/ucs_server_policies/storage/sd_card_policy/openapi/sd_card_policy.json diff --git a/ucs_server/storage/sd_card_policy/powershell/sd_card_policy.ps1 b/policies/ucs_server_policies/storage/sd_card_policy/powershell/sd_card_policy.ps1 similarity index 100% rename from ucs_server/storage/sd_card_policy/powershell/sd_card_policy.ps1 rename to policies/ucs_server_policies/storage/sd_card_policy/powershell/sd_card_policy.ps1 diff --git a/policies/ucs_server_policies/storage/sd_card_policy/python/sd_card_policy.py b/policies/ucs_server_policies/storage/sd_card_policy/python/sd_card_policy.py new file mode 100644 index 0000000..e784114 --- /dev/null +++ b/policies/ucs_server_policies/storage/sd_card_policy/python/sd_card_policy.py @@ -0,0 +1,50 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import sdcard_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.sdcard_policy import SdcardPolicy +from intersight.model.sdcard_partition import SdcardPartition +from intersight.model.sdcard_virtual_drive import SdcardVirtualDrive + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_sd_card_policy(): + # Create an instance of the API class. + api_instance = sdcard_api.SdcardApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create an instance of SdcardVirtualDrive for use in SdcardPartition + virtual_drives = SdcardVirtualDrive(class_id="sdcard.Drivers", + object_type="sdcard.Drivers", + enable=True) + # Create an instance of SdcardPartition + partitions = SdcardPartition(type="Utility", + virtual_drives=[virtual_drives]) + # SdcardPolicy | The 'Sdcard.Policy' resource to create. + sd_card_pol = SdcardPolicy(name="sample_sd_card_policy", + organization=organization, + partitions=[partitions]) + try: + # Create a 'Sdcard.Policy' resource. + api_response = api_instance.create_sdcard_policy(sd_card_pol) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling SdcardApi->create_sdcard_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of sd card policy + create_sd_card_policy() diff --git a/policies/ucs_server_policies/storage/sd_card_policy/readme.md b/policies/ucs_server_policies/storage/sd_card_policy/readme.md new file mode 100644 index 0000000..1257def --- /dev/null +++ b/policies/ucs_server_policies/storage/sd_card_policy/readme.md @@ -0,0 +1,3 @@ +## SD Card Policy +Configures the Cisco FlexFlash and FlexUtil Secure Digital (SD) cards for the Cisco UCS C-Series Standalone M4 and M5 servers. This policy specifies details of virtual drives on the SD cards. You can configure the SD cards in the Operating System Only, Utility Only, or Operating System + Utility modes. +When two cards are present in the Cisco FlexFlash controller and Operating System is chosen in the SD card policy, the configured OS partition is mirrored. If only single card is available in the Cisco FlexFlash controller, the configured OS partition is non-RAID. The utility partitions are always set as non-RAID. diff --git a/ucs_server/storage/sd_card_policy/terraform/sd_card_policy.tf b/policies/ucs_server_policies/storage/sd_card_policy/terraform/sd_card_policy.tf similarity index 100% rename from ucs_server/storage/sd_card_policy/terraform/sd_card_policy.tf rename to policies/ucs_server_policies/storage/sd_card_policy/terraform/sd_card_policy.tf diff --git a/ucs_server/storage/storage_policy/ansible/storage_policy.yaml b/policies/ucs_server_policies/storage/storage_policy/ansible/storage_policy.yaml similarity index 100% rename from ucs_server/storage/storage_policy/ansible/storage_policy.yaml rename to policies/ucs_server_policies/storage/storage_policy/ansible/storage_policy.yaml diff --git a/ucs_server/storage/storage_policy/openapi/storage_policy.json b/policies/ucs_server_policies/storage/storage_policy/openapi/storage_policy.json similarity index 100% rename from ucs_server/storage/storage_policy/openapi/storage_policy.json rename to policies/ucs_server_policies/storage/storage_policy/openapi/storage_policy.json diff --git a/ucs_server/storage/storage_policy/powershell/storage_policy.ps1 b/policies/ucs_server_policies/storage/storage_policy/powershell/storage_policy.ps1 similarity index 100% rename from ucs_server/storage/storage_policy/powershell/storage_policy.ps1 rename to policies/ucs_server_policies/storage/storage_policy/powershell/storage_policy.ps1 diff --git a/policies/ucs_server_policies/storage/storage_policy/python/storage_policy.py b/policies/ucs_server_policies/storage/storage_policy/python/storage_policy.py new file mode 100644 index 0000000..8b885be --- /dev/null +++ b/policies/ucs_server_policies/storage/storage_policy/python/storage_policy.py @@ -0,0 +1,57 @@ +import intersight +import sys + +from authentication.python import intersight_authentication as client +from intersight.api import storage_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.storage_storage_policy import StorageStoragePolicy +from intersight.model.storage_m2_virtual_drive_config import StorageM2VirtualDriveConfig +from intersight.model.storage_r0_drive import StorageR0Drive +from intersight.model.storage_virtual_drive_policy import StorageVirtualDrivePolicy + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_storage_policy(): + # Create an instance of the API class. + api_instance = storage_api.StorageApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create an instance of StorageM2VirtualDriveConfig + m2_virtual_drive = StorageM2VirtualDriveConfig(enable=True, + controller_slot="MSTOR-RAID-1") + # Create an instance of StorageVirtualDrivePolicy for use in StorageR0Drive + virtual_drive_policy = StorageVirtualDrivePolicy(drive_cache="Default", + read_policy="Default", + strip_size=512, + access_policy ="Default") + # Create an instance of StorageR0Drive + raid0_drive = StorageR0Drive(enable=True, + virtual_drive_policy=virtual_drive_policy) + # StorageStoragePolicy | The 'StorageStorage.Policy' resource to create. + storage_pol = StorageStoragePolicy(name="sample_storage_policy", + organization=organization, + default_drive_mode="RAID0", + m2_virtual_drive=m2_virtual_drive, + raid0_drive=raid0_drive) + try: + # Create a 'StorageStorage.Policy' resource. + api_response = api_instance.create_storage_storage_policy(storage_pol) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling StorageApi->create_storage_storage_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of storage policy + create_storage_policy() diff --git a/policies/ucs_server_policies/storage/storage_policy/readme.md b/policies/ucs_server_policies/storage/storage_policy/readme.md new file mode 100644 index 0000000..84e35bb --- /dev/null +++ b/policies/ucs_server_policies/storage/storage_policy/readme.md @@ -0,0 +1,2 @@ +## Storage Policy +Allows you to create drive groups and virtual drives, configure the storage capacity of a virtual drive, and configure the M.2 RAID controllers. diff --git a/ucs_server/storage/storage_policy/terraform/storage_policy.tf b/policies/ucs_server_policies/storage/storage_policy/terraform/storage_policy.tf similarity index 100% rename from ucs_server/storage/storage_policy/terraform/storage_policy.tf rename to policies/ucs_server_policies/storage/storage_policy/terraform/storage_policy.tf diff --git a/authentication/ansible/intersight_authentication.yaml b/pool/IP/openapi/IPPool.json similarity index 100% rename from authentication/ansible/intersight_authentication.yaml rename to pool/IP/openapi/IPPool.json diff --git a/pool/IP/powershell/IPPool.ps1 b/pool/IP/powershell/IPPool.ps1 new file mode 100644 index 0000000..672ab68 --- /dev/null +++ b/pool/IP/powershell/IPPool.ps1 @@ -0,0 +1,21 @@ +# Set up intersight environment this action is required once per powershell session +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# get organization ref +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +# initialize IPv4 config +$ipv4Config = Initialize-IntersightIppoolIpV4Config -Gateway "10.108.190.1" -Netmask "255.255.255.0" -PrimaryDns "10.108.190.100" + +# initialize Ipv4 block +$IPv4Block = Initialize-IntersightIppoolIpV4Block -From "10.108.190.11" -To "10.108.190.20" + +# create IPpool +$result = New-IntersightIppoolPool -Name IpPool_1 -IpV4Blocks @($IPv4Block) -IpV4Config $ipv4Config -Organization $orgRef \ No newline at end of file diff --git a/authentication/openapi/intersight_authentication.json b/pool/IP/python/IPPool.py similarity index 100% rename from authentication/openapi/intersight_authentication.json rename to pool/IP/python/IPPool.py diff --git a/pool/IP/readme.md b/pool/IP/readme.md new file mode 100644 index 0000000..6c2dd86 --- /dev/null +++ b/pool/IP/readme.md @@ -0,0 +1,2 @@ +## IP Pools +An IP Pool can contain one or more blocks of IPs that will get consumed in sequential order, beginning with the lowest block. IP pools support both IPv4 and IPv6 addresses. \ No newline at end of file diff --git a/authentication/readme.md b/pool/IP/terraform/IPPool.tf similarity index 100% rename from authentication/readme.md rename to pool/IP/terraform/IPPool.tf diff --git a/authentication/terraform/intersight_authentication.tf b/pool/IQN/openapi/IQNPool.json similarity index 100% rename from authentication/terraform/intersight_authentication.tf rename to pool/IQN/openapi/IQNPool.json diff --git a/pool/IQN/powershell/IQNPool.ps1 b/pool/IQN/powershell/IQNPool.ps1 new file mode 100644 index 0000000..39e6daf --- /dev/null +++ b/pool/IQN/powershell/IQNPool.ps1 @@ -0,0 +1,18 @@ +# Set up intersight environment this action is required once per powershell session +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# get organization MoRef +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +$iqnSuffixBlock = Initialize-IntersightIqnpoolIqnSuffixBlock -Suffix "iscsi01" -From 0 -To 9 + +# create IqnPool +$result = New-IntersightIqnpoolPool -Name IQNPool_1 -Prefix "iqn.2023-06.abc.com" -IqnSuffixBlocks $iqnSuffixBlock ` + -Organization $orgRef \ No newline at end of file diff --git a/ucs_server/network/ethernet_network_control_policy/python/ethernet_network_control_policy.py b/pool/IQN/python/IQNPool.ps1 similarity index 100% rename from ucs_server/network/ethernet_network_control_policy/python/ethernet_network_control_policy.py rename to pool/IQN/python/IQNPool.ps1 diff --git a/ucs_server/network/ethernet_network_group_policy/python/ethernet_network_group_policy.py b/pool/IQN/python/IQNPool.py similarity index 100% rename from ucs_server/network/ethernet_network_group_policy/python/ethernet_network_group_policy.py rename to pool/IQN/python/IQNPool.py diff --git a/pool/IQN/readme.md b/pool/IQN/readme.md new file mode 100644 index 0000000..a602e74 --- /dev/null +++ b/pool/IQN/readme.md @@ -0,0 +1,4 @@ +## IQN pool +An IQN pool is a collection of iSCSI Qualified Names ``(IQNs)`` for use as initiator identifiers by iSCSI vNICs. IQN pool members are of the form prefix: suffix: number, where you can specify the prefix, suffix, and a block (range) of numbers. + +An IQN pool can contain more than one IQN block, with different number ranges and different suffixes, but sharing the same prefix. \ No newline at end of file diff --git a/pool/IQN/terraform/IQNPool.tf b/pool/IQN/terraform/IQNPool.tf new file mode 100644 index 0000000..e69de29 diff --git a/pool/MAC/openapi/MACPool.json b/pool/MAC/openapi/MACPool.json new file mode 100644 index 0000000..e69de29 diff --git a/pool/MAC/powershell/MACPool.ps1 b/pool/MAC/powershell/MACPool.ps1 new file mode 100644 index 0000000..399fdd4 --- /dev/null +++ b/pool/MAC/powershell/MACPool.ps1 @@ -0,0 +1,18 @@ +# Set up intersight environment this action is required once per powershell session +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# ger organization MoRef +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +#initialize MAC pool bock +$macPoolBlock = Initialize-IntersightMacpoolBlock -From "00:25:B5:00:00:01" -Size 10 + +#create MAC pool +$result = New-IntersightMacpoolPool -Name "MAC_pool_1" -AssignmentOrder Sequential -MacBlocks $macPoolBlock -Organization $orgRef diff --git a/pool/MAC/python/MACPool.py b/pool/MAC/python/MACPool.py new file mode 100644 index 0000000..e69de29 diff --git a/pool/MAC/readme.md b/pool/MAC/readme.md new file mode 100644 index 0000000..c69c08f --- /dev/null +++ b/pool/MAC/readme.md @@ -0,0 +1,2 @@ +## MAC Pool +MAC Pools represent a collection of MAC addresses that can be allocated to vNICs of a server profile. \ No newline at end of file diff --git a/pool/MAC/terraform/MACPool.tf b/pool/MAC/terraform/MACPool.tf new file mode 100644 index 0000000..e69de29 diff --git a/pool/Resource/openapi/ResourcePool.json b/pool/Resource/openapi/ResourcePool.json new file mode 100644 index 0000000..e69de29 diff --git a/pool/Resource/powershell/ResourcePool.ps1 b/pool/Resource/powershell/ResourcePool.ps1 new file mode 100644 index 0000000..bc04573 --- /dev/null +++ b/pool/Resource/powershell/ResourcePool.ps1 @@ -0,0 +1,21 @@ +# Set up intersight environment this action is required once per powershell session +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# get organization ref +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +# initialize resource pool parameter +$ResourcePoolParameters1 = Initialize-IntersightResourcepoolServerPoolParameters -ManagementMode "IntersightStandalone" + +# resource selector +$resourceSelector = Initialize-IntersightResourceSelector -Selector "/api/v1/compute/RackUnits?`$filter=(Serial eq 'EMEDDEC6E0')" + + $result = New-IntersightResourcepoolPool -Name "Resource_pool_1" -AssignmentOrder Sequential -PoolType Static ` + -Organization $orgRef -Selectors $resourceSelector -ResourcePoolParameters $ResourcePoolParameters1 \ No newline at end of file diff --git a/pool/Resource/python/ResourcePool.py b/pool/Resource/python/ResourcePool.py new file mode 100644 index 0000000..e69de29 diff --git a/pool/Resource/readme.md b/pool/Resource/readme.md new file mode 100644 index 0000000..4493ce8 --- /dev/null +++ b/pool/Resource/readme.md @@ -0,0 +1,4 @@ +## Resource Pool +A resource pool is an aggregation of homogeneous resources that are managed in Intersight. A resource pool enables you to manage the utilization of resources for certain Intersight features like Server Profile. Currently, Intersight supports only server type as a resource for the resource pool. + +Resource pool enables you to logically group and manage resources (servers) more efficiently. You can assign servers to a resource pool and can continue with the automated server profile assignment. \ No newline at end of file diff --git a/pool/Resource/terraform/ResourcePool.tf b/pool/Resource/terraform/ResourcePool.tf new file mode 100644 index 0000000..e69de29 diff --git a/pool/UUID/openapi/UUIDPool.json b/pool/UUID/openapi/UUIDPool.json new file mode 100644 index 0000000..e69de29 diff --git a/pool/UUID/powershell/UUIDPool.ps1 b/pool/UUID/powershell/UUIDPool.ps1 new file mode 100644 index 0000000..7c10735 --- /dev/null +++ b/pool/UUID/powershell/UUIDPool.ps1 @@ -0,0 +1,19 @@ +# Set up intersight environment this action is required once per powershell session +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# get organization MoRef +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +# initialize UUID block +$UuidSuffixBlocks11 = Initialize-IntersightUuidpoolUuidBlock -From "0000-001234500A00" -Size 100 + +# create UUID pool +$result = New-IntersightUuidpoolPool -Name "uuuid_pool_1" -Prefix "00000000-0000-00A0" -UuidSuffixBlocks @($UuidSuffixBlocks11) ` + -AssignmentOrder "Default" -Organization $orgRef \ No newline at end of file diff --git a/pool/UUID/python/UUIDPool.py b/pool/UUID/python/UUIDPool.py new file mode 100644 index 0000000..e69de29 diff --git a/pool/UUID/readme.md b/pool/UUID/readme.md new file mode 100644 index 0000000..2262aa8 --- /dev/null +++ b/pool/UUID/readme.md @@ -0,0 +1,2 @@ +## UUI Pool +UUID Pools represent a collection of UUID items that can be allocated to server profiles. \ No newline at end of file diff --git a/pool/UUID/terraform/UUIDPool.tf b/pool/UUID/terraform/UUIDPool.tf new file mode 100644 index 0000000..e69de29 diff --git a/pool/WWNN/openapi/WWNNPool.json b/pool/WWNN/openapi/WWNNPool.json new file mode 100644 index 0000000..e69de29 diff --git a/pool/WWNN/powershell/WWNNPool.ps1 b/pool/WWNN/powershell/WWNNPool.ps1 new file mode 100644 index 0000000..3c7afe5 --- /dev/null +++ b/pool/WWNN/powershell/WWNNPool.ps1 @@ -0,0 +1,19 @@ +# Set up intersight environment this action is required once per powershell session +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# get organization MoRef +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +# initialize FC pool block +$fcBlocks = Initialize-IntersightFcpoolBlock -From "20:00:00:25:B5:00:00:01" -Size 100 + +# create WWNN pool +$result = New-IntersightFcpoolPool -Name "wwnn_pool_1" -AssignmentOrder "Default" -IdBlocks @($fcBlocks) -PoolPurpose "WWNN" ` + -Organization $orgRef \ No newline at end of file diff --git a/pool/WWNN/python/WWNNPool.py b/pool/WWNN/python/WWNNPool.py new file mode 100644 index 0000000..e69de29 diff --git a/pool/WWNN/readme.md b/pool/WWNN/readme.md new file mode 100644 index 0000000..c847c38 --- /dev/null +++ b/pool/WWNN/readme.md @@ -0,0 +1,2 @@ +## WWNN Pool +A WWNN pool is a WWN pool that contains only WW node names. If you include a pool of WWNNs in a server profile, the associated server is assigned a WWNN from that pool. \ No newline at end of file diff --git a/pool/WWNN/terraform/WWNNPool.tf b/pool/WWNN/terraform/WWNNPool.tf new file mode 100644 index 0000000..e69de29 diff --git a/pool/WWPN/openapi/WWPNPool.json b/pool/WWPN/openapi/WWPNPool.json new file mode 100644 index 0000000..e69de29 diff --git a/pool/WWPN/powershell/WWPNPool.ps1 b/pool/WWPN/powershell/WWPNPool.ps1 new file mode 100644 index 0000000..f9f7f98 --- /dev/null +++ b/pool/WWPN/powershell/WWPNPool.ps1 @@ -0,0 +1,19 @@ +# Set up intersight environment this action is required once per powershell session +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# get organization MoRef +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +# initialize FC pool block +$fcPoolBlocks = Initialize-IntersightFcpoolBlock -From "20:00:00:25:B5:00:10:00" -Size 100 + +# create WWPN pool +$result = New-IntersightFcpoolPool -Name "wwpn_pool_1" -PoolPurpose "WWPN" -IdBlocks @($fcPoolBlocks)` + -AssignmentOrder "Default" -Organization $orgRef \ No newline at end of file diff --git a/pool/WWPN/python/WWPNPool.py b/pool/WWPN/python/WWPNPool.py new file mode 100644 index 0000000..e69de29 diff --git a/pool/WWPN/readme.md b/pool/WWPN/readme.md new file mode 100644 index 0000000..6e1fb5b --- /dev/null +++ b/pool/WWPN/readme.md @@ -0,0 +1,2 @@ +## WWPN Pool +A WWPN pool is a WWN pool that contains only WW port names. If you include a pool of WWPNs in a server profile, the port on each vHBA of the associated server is assigned a WWPN from that pool. diff --git a/pool/WWPN/terraform/WWPNPool.tf b/pool/WWPN/terraform/WWPNPool.tf new file mode 100644 index 0000000..e69de29 diff --git a/profile/ucs_chassis_profile/powershell/ucs_chassis_profile.ps1 b/profile/ucs_chassis_profile/powershell/ucs_chassis_profile.ps1 index c11a9d5..4f31fef 100644 --- a/profile/ucs_chassis_profile/powershell/ucs_chassis_profile.ps1 +++ b/profile/ucs_chassis_profile/powershell/ucs_chassis_profile.ps1 @@ -12,10 +12,10 @@ Set-IntersightConfiguration @config $orgRef = Get-IntersightOrganizationOrganization -Name "default" | Get-IntersightMoMoRef # get MoRef of chassis policies -$imcAccessRef = Get-IntersightAccessPolicy -Name "" | Get-IntersightMoMoRef -$powerPolicyRef = Get-IntersightPowerPolicy -Name "" | Get-IntersightMoMoRef -$snmpPolicyRef = Get-IntersightSnmpPolicy -Name "" | Get-IntersightMoMoRef -$thermalPolicyRef = Get-IntersightThermalPolicy -Name "" | Get-IntersightMoMoRef +$imcAccessRef = Get-IntersightAccessPolicy -Name "access_policy_1" | Get-IntersightMoMoRef +$powerPolicyRef = Get-IntersightPowerPolicy -Name "power_policy_1" | Get-IntersightMoMoRef +$snmpPolicyRef = Get-IntersightSnmpPolicy -Name "snmp_policy_1" | Get-IntersightMoMoRef +$thermalPolicyRef = Get-IntersightThermalPolicy -Name "thermal_policy_1" | Get-IntersightMoMoRef # create a chassis profile $chassisProfile = New-IntersightChassisProfile -Name "sample_chassis_profile_1" -Organization $orgRef ` diff --git a/profile/ucs_chassis_profile/python/ucs_chassis_profile.py b/profile/ucs_chassis_profile/python/ucs_chassis_profile.py index e69de29..5e98fb9 100644 --- a/profile/ucs_chassis_profile/python/ucs_chassis_profile.py +++ b/profile/ucs_chassis_profile/python/ucs_chassis_profile.py @@ -0,0 +1,81 @@ +from authentication.python import intersight_authentication as client + +from intersight.api import chassis_api, power_api, snmp_api, thermal_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.chassis_profile import ChassisProfile +from intersight.model.power_policy import PowerPolicy +from intersight.model.snmp_policy import SnmpPolicy +from intersight.model.thermal_policy import ThermalPolicy +from intersight.model.policy_abstract_policy_relationship import PolicyAbstractPolicyRelationship +import intersight +import sys + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_power_policy(): + # Create an instance of the API class. + api_instance = power_api.PowerApi(api_client) + # Create an instance of organization. + organization = create_organization() + power_policy = PowerPolicy(name="sample_power_policy",organization=organization) + api_response = api_instance.create_power_policy(power_policy) + return PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type=api_response.object_type, + moid=api_response.moid) +def create_snmp_policy(): + # Create an instance of the API class. + api_instance = snmp_api.SnmpApi(api_client) + # Create an instance of organization. + organization = create_organization() + snmp_policy = SnmpPolicy(name="sample_snmp_policy",organization=organization) + api_response = api_instance.create_snmp_policy(snmp_policy) + return PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type=api_response.object_type, + moid=api_response.moid) +def create_thermal_policy(): + # Create an instance of the API class. + api_instance = thermal_api.ThermalApi(api_client) + # Create an instance of organization. + organization = create_organization() + thermal_policy = ThermalPolicy(name="sample_thermal_policy", organization=organization) + api_response = api_instance.create_thermal_policy(thermal_policy) + return PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type=api_response.object_type, + moid=api_response.moid) + +def create_ucs_chassis_profile(): + # Create an instance of the API class. + api_instance = chassis_api.ChassisApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create a reference to different policies + powerPolicyRef = create_power_policy() + snmpPolicyRef = create_snmp_policy() + thermalPolicyRef = create_thermal_policy() + # Create an instance of policy bucket + policy_bucket = [powerPolicyRef, snmpPolicyRef, thermalPolicyRef] + # ChassisProfile | The 'ChassisProfile' resource to create. + chassis_profile = ChassisProfile(name="sample_chassis_profile_1", + organization=organization, + policy_bucket=policy_bucket) + try: + # Create a 'Chassis.Profile' resource. + api_response = api_instance.create_chassis_profile(chassis_profile) + print(api_response) + except intersight.ApiException as e: + print("Exception when calling ServerApi->patch_server_profile: %s\n" % e) + sys.exit(1) + +if __name__ == "__main__": + # Trigger creation of ucs chassis profile + create_ucs_chassis_profile() \ No newline at end of file diff --git a/profile/ucs_chassis_profile/readme.md b/profile/ucs_chassis_profile/readme.md index c9db8c7..dc77987 100644 --- a/profile/ucs_chassis_profile/readme.md +++ b/profile/ucs_chassis_profile/readme.md @@ -1,10 +1,2 @@ ## Chassis Profile A UCS Chassis profile enables to create and associate chassis policy to an Intersight Managed Mode (IMM) claimed chassis. When a chassis profile is associated to a chassis, Cisco Intersight automatically configures the chassis to match the configuration specified in the policies of the chassis profile. - -## Chassis Profile Properties Reference - -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [ChassisProfile](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/chassis_profile.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [ChassisProfile](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/chassis_profile) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [ChassisProfile](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightChassisProfile.md) properties reference | diff --git a/profile/ucs_domain_profile/python/ucs_domain_profile.py b/profile/ucs_domain_profile/python/ucs_domain_profile.py index 716d488..9f6cf38 100644 --- a/profile/ucs_domain_profile/python/ucs_domain_profile.py +++ b/profile/ucs_domain_profile/python/ucs_domain_profile.py @@ -2,7 +2,12 @@ import sys from authentication.python import intersight_authentication as client -from intersight.api import fabric_api +from intersight.api import fabric_api, power_api, snmp_api, thermal_api +from intersight.model.power_policy import PowerPolicy +from intersight.model.snmp_policy import SnmpPolicy +from intersight.model.thermal_policy import ThermalPolicy +from intersight.model.policy_abstract_policy_relationship import PolicyAbstractPolicyRelationship +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.fabric_switch_profile import FabricSwitchProfile from intersight.model.fabric_switch_cluster_profile import FabricSwitchClusterProfile from intersight.model.fabric_switch_cluster_profile_relationship import FabricSwitchClusterProfileRelationship @@ -13,23 +18,74 @@ api_client = client.get_api_client(api_key, api_key_file) # Create an instance of the API class. api_instance = fabric_api.FabricApi(api_client) + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + +def create_power_policy(): + # Create an instance of the API class. + api_instance = power_api.PowerApi(api_client) + # Create an instance of organization. + organization = create_organization() + power_policy = PowerPolicy(name="sample_power_policy",organization=organization) + api_response = api_instance.create_power_policy(power_policy) + return PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type=api_response.object_type, + moid=api_response.moid) +def create_snmp_policy(): + # Create an instance of the API class. + api_instance = snmp_api.SnmpApi(api_client) + # Create an instance of organization. + organization = create_organization() + snmp_policy = SnmpPolicy(name="sample_snmp_policy",organization=organization) + api_response = api_instance.create_snmp_policy(snmp_policy) + return PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type=api_response.object_type, + moid=api_response.moid) +def create_thermal_policy(): + # Create an instance of the API class. + api_instance = thermal_api.ThermalApi(api_client) + # Create an instance of organization. + organization = create_organization() + thermal_policy = ThermalPolicy(name="sample_thermal_policy", organization=organization) + api_response = api_instance.create_thermal_policy(thermal_policy) + return PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type=api_response.object_type, + moid=api_response.moid) + +def get_policy_bucket(): + powerPolicyRef = create_power_policy() + snmpPolicyRef = create_snmp_policy() + thermalPolicyRef = create_thermal_policy() + policy_bucket = [powerPolicyRef, snmpPolicyRef, thermalPolicyRef] + return policy_bucket def create_fabric_switch_cluster_profile(): - fabric_switch_cluster_profile = FabricSwitchClusterProfile(name="sample_switch_cluster_profile") + # Create an instance of organization. + organization = create_organization() + fabric_switch_cluster_profile = FabricSwitchClusterProfile(name="sample_switch_cluster_profile", + organization=organization) cluster_profile = api_instance.create_fabric_switch_cluster_profile(fabric_switch_cluster_profile) return cluster_profile - def create_policy_reference(cluster_profile): - profile_ref = FabricSwitchClusterProfileRelationship( - moid=cluster_profile.moid, object_type="fabric.SwitchClusterProfile", class_id="mo.MoRef") + # Create an instance of organization. + organization = create_organization() + profile_ref = FabricSwitchClusterProfileRelationship(moid=cluster_profile.moid, + object_type="fabric.SwitchClusterProfile", + class_id="mo.MoRef", + organization=organization) return profile_ref -def create_fabric_switch_profile(profile_ref): +def create_fabric_switch_profile(profile_ref, policy_bucket): switch_prof = FabricSwitchProfile(name="sample_fabric_switch_profile") switch_prof.switch_cluster_profile = profile_ref + switch_prof.policy_bucket = policy_bucket try: api_response = api_instance.create_fabric_switch_profile(switch_prof) print(api_response) @@ -42,4 +98,5 @@ def create_fabric_switch_profile(profile_ref): # Trigger creation of ucs domain profile cluster_prof = create_fabric_switch_cluster_profile() policy_ref = create_policy_reference(cluster_prof) - create_fabric_switch_profile(policy_ref) + policy_bucket = get_policy_bucket() + create_fabric_switch_profile(policy_ref, policy_bucket) \ No newline at end of file diff --git a/profile/ucs_domain_profile/readme.md b/profile/ucs_domain_profile/readme.md index abb7d70..865af1b 100644 --- a/profile/ucs_domain_profile/readme.md +++ b/profile/ucs_domain_profile/readme.md @@ -1,10 +1,2 @@ ## Domain Profile A UCS Domain Profile configures a Fabric Interconnect pair through reusable policies, allows for configuration of the ports and port channels, and configures the VLANs and VSANs in the network. It defines the characteristics of and configures ports on Fabric Interconnects. - -## Fabric Switch Profile Properties Reference - -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [FabricSwitchProfile](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_switch_profile.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [FabricSwitchProfile](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_switch_profile) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [FabricSwitchProfile](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricSwitchProfile.md) properties reference | diff --git a/profile/ucs_server_profile/python/ucs_server_profile.py b/profile/ucs_server_profile/python/ucs_server_profile.py index 0109d40..edb8f50 100644 --- a/profile/ucs_server_profile/python/ucs_server_profile.py +++ b/profile/ucs_server_profile/python/ucs_server_profile.py @@ -25,9 +25,10 @@ def create_organization(): - # Creating and returning an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_policy_reference(policy_moid, obj_type): @@ -49,6 +50,7 @@ def create_server_profile(): server_profile.name = "sample_server_profile1" server_profile.description = "sample server profile." server_profile.organization = organization + server_profile.target_platform = "Standalone" # example passing only required values which don't have defaults set try: diff --git a/profile/ucs_server_profile/readme.md b/profile/ucs_server_profile/readme.md index 9f88b6c..1515cbb 100644 --- a/profile/ucs_server_profile/readme.md +++ b/profile/ucs_server_profile/readme.md @@ -1,13 +1,7 @@ ## ServerProfile a Server Profile enables resource management by streamlining policy alignment, and server configuration -## ServerProfile Properties Reference -| SKDs | properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [ServerProfile](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/server_profile.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [ServerProfile](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/server_profile) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [ServerProfile](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightServerProfile.md) properties reference | diff --git a/template/ucs_server_profile_template/python/ucs_server_profile_template.py b/template/ucs_server_profile_template/python/ucs_server_profile_template.py index c5d3468..0f87b88 100644 --- a/template/ucs_server_profile_template/python/ucs_server_profile_template.py +++ b/template/ucs_server_profile_template/python/ucs_server_profile_template.py @@ -3,7 +3,9 @@ from authentication.python import intersight_authentication as client from intersight.api import server_api +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship from intersight.model.server_profile_template import ServerProfileTemplate +from intersight.model.policy_abstract_policy_relationship import PolicyAbstractPolicyRelationship api_key = "api_key" api_key_file = "~/api_key_file_path" @@ -11,11 +13,34 @@ api_client = client.get_api_client(api_key, api_key_file) +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + + def create_ucs_server_profile_template(): # Create an instance of the API class. api_instance = server_api.ServerApi(api_client) + # Create an instance of organization. + organization = create_organization() + # Create a reference to different policies + ntp_policy_ref = PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type="ntp.Policy", + moid="moid_of_ntp_policy") + kvm_policy_ref = PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type="kvm.Policy", + moid="moid_of_kvm_policy") + bios_policy_ref = PolicyAbstractPolicyRelationship(class_id="mo.MoRef", + object_type="bios.Policy", + moid="moid_of_bios_policy") + # Create an instance of policy bucket + policy_bucket = [ntp_policy_ref, kvm_policy_ref, bios_policy_ref] # ServerProfileTemplate | The 'ServerProfile.Template' resource to create. - ser_pro = ServerProfileTemplate(name="sample_ucs_server_profile_template") + ser_pro = ServerProfileTemplate(name="sample_ucs_server_profile_template", + organization=organization, + policy_bucket=policy_bucket) try: # Create a 'ServerProfile.Template' resource. api_response = api_instance.create_server_profile_template(ser_pro) diff --git a/template/ucs_server_profile_template/readme.md b/template/ucs_server_profile_template/readme.md index 937934b..64a1f74 100644 --- a/template/ucs_server_profile_template/readme.md +++ b/template/ucs_server_profile_template/readme.md @@ -1,9 +1,2 @@ ## Server Profile Template In Cisco Intersight, Server Profile Templates enable the user to define a template from which multiple server profiles can be derived and deployed. Any property modification made in the template syncs with all the derived profiles. You can deploy these modified profiles individually. This feature helps in the quick and easy configuration as multiple profiles can be created and edited simultaneously. - -## Server Profile Template Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Server Profile Template](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/server_profile_template.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Server Profile Template](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/server_profile_template) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Server Profile Template](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightServerProfileTemplate.md) properties reference \ No newline at end of file diff --git a/ucs_domain/link_aggregation_policy/readme.md b/ucs_domain/link_aggregation_policy/readme.md deleted file mode 100644 index 359cb6f..0000000 --- a/ucs_domain/link_aggregation_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## Link Aggregation Policy -Enables to configure Link Aggregation properties. Link Aggregation combines multiple network connections in parallel to increase throughput and to provide redundancy. - -## Link Aggregation Policy Properties Reference - -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Fabric Link Aggregation Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_link_aggregation_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Fabric Link Aggregation Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_link_aggregation_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Fabric Link Aggregation Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricLinkAggregationPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/link_control_policy/readme.md b/ucs_domain/link_control_policy/readme.md deleted file mode 100644 index 1f2e20b..0000000 --- a/ucs_domain/link_control_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## Link Control Policy -Enables configurations of Link Control administrative state and configuration (normal or aggressive) mode for ports. - -## Link Control Policy Properties Reference - -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Fabric Link Control Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_link_control_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Fabric Link Control Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_link_control_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Fabric Link Control Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricLinkControlPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/multicast_policy/readme.md b/ucs_domain/multicast_policy/readme.md deleted file mode 100644 index 01662a1..0000000 --- a/ucs_domain/multicast_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## Multicast Policy -Multicast policy is used to configure Internet Group Management Protocol (IGMP) snooping and IGMP querier. - -## Multicast Policy Properties Reference - -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Fabric Multicast Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_multicast_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Fabric Multicast Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_multicast_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Fabric Multicast Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricMulticastPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/network_connectivity_policy/readme.md b/ucs_domain/network_connectivity_policy/readme.md deleted file mode 100644 index 3f03b24..0000000 --- a/ucs_domain/network_connectivity_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Network Config Policy -Specifies the DNS Domain settings that are used to add or update the resource records on the DNS server from the endpoints, and the DNS server settings for IPv4 and IPv6 on an endpoint. - -## Netwrok Config Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Netwrok Config Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/networkconfig_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Netwrok Config Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/networkconfig_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Netwrok Config Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightNetworkconfigPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/network_control_policy/readme.md b/ucs_domain/network_control_policy/readme.md deleted file mode 100644 index af09cde..0000000 --- a/ucs_domain/network_control_policy/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -## Network Control Policy -Configures the network control settings for the appliance ports, appliance port channels, or vNICs. - - -## Netwrok Control Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Netwrok Control Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_eth_network_control_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Netwrok Control Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_eth_network_control_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Netwrok Control Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricEthNetworkControlPolicy.md) properties reference - diff --git a/ucs_domain/network_group_policy/readme.md b/ucs_domain/network_group_policy/readme.md deleted file mode 100644 index 95d5378..0000000 --- a/ucs_domain/network_group_policy/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -## Network Group Policy -Configures the allowed VLAN and native VLAN for the appliance ports, appliance port channels, or vNICs. - -## Netwrok Group Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Netwrok Group Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_eth_network_group_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Netwrok Group Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_eth_network_group_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Netwrok Group Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricEthNetworkGroupPolicy.md) properties reference - -fabric_eth_network_group_Policy \ No newline at end of file diff --git a/ucs_domain/ntp_policy/readme.md b/ucs_domain/ntp_policy/readme.md deleted file mode 100644 index 07a46ea..0000000 --- a/ucs_domain/ntp_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## NTP Policy -Allows you to enable the NTP service on an Intersight Managed Cisco IMC (Standalone) server. The NTP service synchronizes the time with an NTP server. You must enable and configure the NTP service by specifying the IP address or DNS of a minimum of one to a maximum of four NTP servers. - -## Ntp Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Ntp Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/ntp_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Ntp Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/ntp_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Ntp Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightNtpPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/snmp_policy/readme.md b/ucs_domain/snmp_policy/readme.md deleted file mode 100644 index 164ff10..0000000 --- a/ucs_domain/snmp_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## SNMP POlicy -Configures the SNMP settings for sending fault and alert information by SNMP traps from the managed devices. Any existing SNMP Users or SNMP Traps configured previously on the managed devices are removed and replaced with users or traps that you configure in this policy. - -## SNMP Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [SNMP Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/snmp_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [SNMP Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/snmp_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [SNMP Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightSnmpPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/switch_control_policy/readme.md b/ucs_domain/switch_control_policy/readme.md deleted file mode 100644 index 38e3541..0000000 --- a/ucs_domain/switch_control_policy/readme.md +++ /dev/null @@ -1,16 +0,0 @@ -## Switch Control Policy -Enables to configure and manage multiple network operations on the Fabric Interconnects (FI) that include: - -- Port Count Optimization—If the VLAN port count optimization is enabled, the Virtual Port (VP) groups are configured on the Fabric Interconnect (FI) and if VLAN port count optimization is disabled, the configured VP groups are removed from the FI. - -- MAC Aging Time—Allows to set the MAC aging time for the MAC address table entries. The MAC aging time specifies the time before a MAC entry expires and discards the entry from the MAC address table. - -- Link Control Global Settings—Enables configurations of message interval time in seconds and allows to reset the recovery action of an error-disabled port. - - -## Switch Control Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Switch Control Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_switch_control_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Switch Control Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_switch_control_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Switch Control Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricSwitchControlPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/syslog_policy/readme.md b/ucs_domain/syslog_policy/readme.md deleted file mode 100644 index fbe1665..0000000 --- a/ucs_domain/syslog_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ - -## Syslog Policy -Enables to configure the local logging and remote logging (minimum severity) for an endpoint. This policy also provides configuration support to store the syslog messages in the local file and the remote syslog server. - -## Syslog Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Syslog Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/syslog_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Syslog Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/syslog_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Syslog Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricSyslogPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_domain/vlan_configuration_policy/readme.md b/ucs_domain/vlan_configuration_policy/readme.md deleted file mode 100644 index 526ff10..0000000 --- a/ucs_domain/vlan_configuration_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## VLAN Configuration Policy -Creates a connection to a specific external LAN. - -## VLAN Configuration Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [VLAN Configuration Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_vlan.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [VLAN Configuration Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_vlan) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [VLAN Configuration Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricVlan.md) properties reference - diff --git a/ucs_domain/vsan_configuration_policy/readme.md b/ucs_domain/vsan_configuration_policy/readme.md deleted file mode 100644 index aa69318..0000000 --- a/ucs_domain/vsan_configuration_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## VSAN Configuration Policy -Partitions the Fibre Channel fabric into one or more zones. Each zone defines the set of Fibre Channel initiators and Fibre Channel targets that can communicate with each other in a VSAN. - -## VSAN Configuration Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [VSAN Configuration Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_vsan.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [VSAN Configuration Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_vsan) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [VSAN Configuration Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricVsan.md) properties reference \ No newline at end of file diff --git a/ucs_server/compute/bios_policy/readme.md b/ucs_server/compute/bios_policy/readme.md deleted file mode 100644 index f9cd5d8..0000000 --- a/ucs_server/compute/bios_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## BIOS Policy -A BIOS policy automates the configuration of BIOS settings on servers. You can create one or more BIOS policies that contain a specific grouping of BIOS settings, matching the needs of a server or a set of servers. If you do not specify a BIOS policy for a server, the BIOS settings will default to set of values for a brand new baremetal server or to a set of values previously configured using Cisco IMC. If a BIOS policy is specified, its values replace any previously configured values on the server. - -## Bios Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Bios Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/bios_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Bios Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/bios_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Bios Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightBiosPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/compute/boot_order_policy/python/boot_order_policy.py b/ucs_server/compute/boot_order_policy/python/boot_order_policy.py deleted file mode 100644 index 4126e73..0000000 --- a/ucs_server/compute/boot_order_policy/python/boot_order_policy.py +++ /dev/null @@ -1,77 +0,0 @@ -from authentication.python import intersight_authentication as client - -from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship -from intersight.model.boot_precision_policy import BootPrecisionPolicy -from intersight.model.boot_device_base import BootDeviceBase -from intersight.model.bios_policy import BiosPolicy -from intersight.api import boot_api -import intersight - -from pprint import pprint -import sys - - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_organization(): - # Creating an instance of organization - return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - - -def create_boot_local_cdd(): - # Creating an instance of boot_local_cdd - boot_local_cdd = BootDeviceBase(class_id="boot.LocalCdd", - object_type="boot.LocalCdd", - name="local_cdd1", - enabled=True) - return boot_local_cdd - - -def create_boot_local_disk(): - # Creating an instance of boot_local_disk - boot_local_disk = BootDeviceBase(class_id="boot.LocalDisk", - object_type="boot.LocalDisk", - name="local_disk1", - enabled=True) - return boot_local_disk - - -def create_boot_precision_policy(): - api_instance = boot_api.BootApi(api_client) - - # Create an instance of local_cdd, local_disk, organization and list of boot_devices. - boot_local_cdd = create_boot_local_cdd() - boot_local_disk = create_boot_local_disk() - organization = create_organization() - boot_devices = [ - boot_local_disk, - boot_local_cdd, - ] - - # BootPrecisionPolicy | The 'boot.PrecisionPolicy' resource to create. - boot_precision_policy = BootPrecisionPolicy() - - # Setting all the attributes for boot_precison_policy instance. - boot_precision_policy.name = "sample_boot_policy1" - boot_precision_policy.description = "sample boot precision policy" - boot_precision_policy.boot_devices = boot_devices - boot_precision_policy.organization = organization - - try: - # Create a 'boot.PrecisionPolicy' resource. - resp_boot_precision_policy = api_instance.create_boot_precision_policy(boot_precision_policy) - pprint(resp_boot_precision_policy) - return resp_boot_precision_policy - except intersight.ApiException as e: - print("Exception when calling BootApi->create_boot_precision_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of boot precision policy - create_boot_precision_policy() \ No newline at end of file diff --git a/ucs_server/compute/boot_order_policy/readme.md b/ucs_server/compute/boot_order_policy/readme.md deleted file mode 100644 index 12a5c5a..0000000 --- a/ucs_server/compute/boot_order_policy/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -## BootOrder Policy -Configures the linear ordering of devices and enables you to change the boot order and boot mode. You can also add multiple devices under various device types, rearrange the boot order, and set parameters for each boot device type. - -The inventory view enables you to view the actual boot order configured on a server. The boot order displays the details that include device name, device type, configuration details such as Boot Mode (Legacy or UEFI), and Secure Boot Mode (Enabled or Disabled). - -## Boot Order Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Boot Order Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/boot_precision_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Boot Order Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/boot_precision_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Boot Order Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightBootPrecisionPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/compute/firmware_policy/openapi/firmware_policy.json b/ucs_server/compute/firmware_policy/openapi/firmware_policy.json new file mode 100644 index 0000000..e69de29 diff --git a/ucs_server/compute/firmware_policy/powershell/firmware_policy.ps1 b/ucs_server/compute/firmware_policy/powershell/firmware_policy.ps1 new file mode 100644 index 0000000..0c9e98a --- /dev/null +++ b/ucs_server/compute/firmware_policy/powershell/firmware_policy.ps1 @@ -0,0 +1,18 @@ +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# get organization MoRef +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +# initialize Model bundle version +$modelBundleVersion = Initialize-IntersightFirmwareModelBundleVersion -ModelFamily UCSCC220M7 -BundleVersion "4.3(3.240043)" + +# create firmware policy +$result = New-IntersightFirmwarePolicy -Name "firmware_policy_1" -TargetPlatform Standalone -ModelBundleCombo $modelBundleVersion ` + -Organization $orgRef \ No newline at end of file diff --git a/ucs_server/compute/firmware_policy/python/firmware_policy.py b/ucs_server/compute/firmware_policy/python/firmware_policy.py new file mode 100644 index 0000000..e0f250f --- /dev/null +++ b/ucs_server/compute/firmware_policy/python/firmware_policy.py @@ -0,0 +1,58 @@ +from authentication.python import intersight_authentication as client + +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.firmware_policy import FirmwarePolicy +from intersight.model.firmware_model_bundle_version import FirmwareModelBundleVersion +from intersight.api import firmware_api +import intersight + +from pprint import pprint +import sys + + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + + + + +def create_firmware_policy(): + api_instance = firmware_api.FirmwareApi(api_client) + + # Create an instance of organization and firmware model bundle version. + organization = create_organization() + + model_bundle_version = FirmwareModelBundleVersion(model_family="UCSC-C220-M7", + bundle_version="4.3(3.240043)") + + # FirmwarePolicy | The 'firmware.Policy' resource to create. + firmware_policy = FirmwarePolicy() + + # Setting attributes for firmware_policy instance. + firmware_policy.name = "sample_firmware_policy" + firmware_policy.target_platform = "Standalone" + firmware_policy.model_bundle_combo = [model_bundle_version] + firmware_policy.organization = organization + + try: + # Create a 'firmware.Policy' resource. + resp_firmware_policy = api_instance.create_firmware_policy(firmware_policy) + pprint(resp_firmware_policy) + return resp_firmware_policy + except intersight.ApiException as e: + print("Exception when calling FirmwareApi->create_firmware_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of firmware policy + create_firmware_policy() \ No newline at end of file diff --git a/ucs_server/compute/firmware_policy/readme.md b/ucs_server/compute/firmware_policy/readme.md new file mode 100644 index 0000000..6c6ecee --- /dev/null +++ b/ucs_server/compute/firmware_policy/readme.md @@ -0,0 +1,2 @@ +## Firmware Policy +This policy allows you to see the firmware present in your systems, as against the firmware baseline. Firmware policy also enables you to bring the firmware of your systems in line with the desired version and thereby enables the drive to compliance. \ No newline at end of file diff --git a/ucs_server/compute/firmware_policy/terraform/firmware_policy.tf b/ucs_server/compute/firmware_policy/terraform/firmware_policy.tf new file mode 100644 index 0000000..e69de29 diff --git a/ucs_server/compute/power_policy/readme.md b/ucs_server/compute/power_policy/readme.md deleted file mode 100644 index d03094d..0000000 --- a/ucs_server/compute/power_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Power Policy -Enables the management of power for FI-attached servers and chassis. This policy allows you to set the power profiling, power priority of the server, and the power restore state of the system. - -## Power Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Power Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/power_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Power Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/power_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Power Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightPowerPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/compute/thermal_policy/powershell/thermal_policy.ps1 b/ucs_server/compute/thermal_policy/powershell/thermal_policy.ps1 new file mode 100644 index 0000000..a2e191b --- /dev/null +++ b/ucs_server/compute/thermal_policy/powershell/thermal_policy.ps1 @@ -0,0 +1,15 @@ +# Set up intersight environment this action is required once per powershell session +$config = @{ + BasePath = "https://intersight.com" + ApiKeyId = "xxxxx27564612d30dxxxxx/5f21c9d97564612d30dd575a/5f9a8b877564612xxxxxxxx" + ApiKeyFilePath = "C:\\secretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} +# set intersight configuration +Set-IntersightConfiguration @config + +# get organization MoRef +$orgRef = Get-IntersightOrganizationOrganization -Name default | Get-IntersightMoMoRef + +# create thermal policy +$result = New-IntersightThermalPolicy -Name "thermal_policy_1" -FanControlMode Balanced -Organization $orgRef \ No newline at end of file diff --git a/ucs_server/compute/thermal_policy/python/thermal_policy.py b/ucs_server/compute/thermal_policy/python/thermal_policy.py new file mode 100644 index 0000000..3528357 --- /dev/null +++ b/ucs_server/compute/thermal_policy/python/thermal_policy.py @@ -0,0 +1,52 @@ +from authentication.python import intersight_authentication as client + +from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship +from intersight.model.thermal_policy import ThermalPolicy +from intersight.api import thermal_api +import intersight + +from pprint import pprint +import sys + + +api_key = "api_key" +api_key_file = "~/api_key_file_path" + +api_client = client.get_api_client(api_key, api_key_file) + + +def create_organization(): + # Creating an instance of organization using its moid, under which policy should be created + return OrganizationOrganizationRelationship(class_id="mo.MoRef", + object_type="organization.Organization", + moid="moid_of_organization") + + + +def create_thermal_policy(): + api_instance = thermal_api.ThermalApi(api_client) + + # Create an instance of organization. + organization = create_organization() + + # ThermalPolicy | The 'thermal.Policy' resource to create. + thermal_policy = ThermalPolicy() + + # Setting attributes for thermal_policy instance. + thermal_policy.name = "sample_thermal_policy" + thermal_policy.fan_control_mode = "Balanced" + thermal_policy.organization = organization + + try: + # Create a 'thermal.Policy' resource. + resp_thermal_policy = api_instance.create_thermal_policy(thermal_policy) + pprint(resp_thermal_policy) + return resp_thermal_policy + except intersight.ApiException as e: + print("Exception when calling ThermalApi->create_thermal_policy: %s\n" % e) + sys.exit(1) + + +if __name__ == "__main__": + # Trigger creation of thermal policy + create_thermal_policy() \ No newline at end of file diff --git a/ucs_server/compute/thermal_policy/readme.md b/ucs_server/compute/thermal_policy/readme.md new file mode 100644 index 0000000..b5309ee --- /dev/null +++ b/ucs_server/compute/thermal_policy/readme.md @@ -0,0 +1,2 @@ +## Thermal Policy +This policy enables controlling the speed of the chassis fan. \ No newline at end of file diff --git a/ucs_server/compute/virtual_media_policy/readme.md b/ucs_server/compute/virtual_media_policy/readme.md deleted file mode 100644 index 3f6425f..0000000 --- a/ucs_server/compute/virtual_media_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Virtual Media Policy -Enables you to install an operating system on the server using the KVM console and virtual media, mount files to the host from a remote file share, and enable virtual media encryption. You can create one or more Virtual Media policies which contain virtual media mappings for different OS images, and configure up to two virtual media mappings, one for ISO files (through CDD), and the other for IMG files (through HDD). - -## Virtiual Media Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Virtual Media Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vmedia_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Virtual Media Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vmedia_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Virtual Media Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVmediaPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/management/imc_access_policy/readme.md b/ucs_server/management/imc_access_policy/readme.md deleted file mode 100644 index 6fabad9..0000000 --- a/ucs_server/management/imc_access_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## IMC Access Policy -Enables you to configure and manage your network through mapping of IP pools to the server profile. This policy allows you to configure a VLAN and associate it with an IP address through the IP pool address. -In-Band IP addresses, Out-Of-Band IP addresses, or both can be configured using the IMC Access Policy. vKVM, IPMI, SOL, and vMedia using vKVM client can be used with either In-Band or Out-Of-Band IP addresses. SNMP, vMedia, and Syslog are currently supported only with In-band IP address and not with Out-Of-Band IP address. - -## IMC Access Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [IMC Access Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/access_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [IMC Access Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/access_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [IMC Access Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightAccessPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/management/ipmi_over_lan_policy/python/impi_over_lan_policy.py b/ucs_server/management/ipmi_over_lan_policy/python/impi_over_lan_policy.py index 5a351bf..f7dd6d5 100644 --- a/ucs_server/management/ipmi_over_lan_policy/python/impi_over_lan_policy.py +++ b/ucs_server/management/ipmi_over_lan_policy/python/impi_over_lan_policy.py @@ -16,9 +16,10 @@ def create_organization(): - # Creating an instance of organization + # Creating an instance of organization using its moid, under which policy should be created return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") + object_type="organization.Organization", + moid="moid_of_organization") def create_ipmi_over_lan_policy(): diff --git a/ucs_server/management/ipmi_over_lan_policy/readme.md b/ucs_server/management/ipmi_over_lan_policy/readme.md index 40cc16f..2c2c092 100644 --- a/ucs_server/management/ipmi_over_lan_policy/readme.md +++ b/ucs_server/management/ipmi_over_lan_policy/readme.md @@ -1,9 +1,2 @@ ## IPMI over LAN Policy -Defines the protocols for interfacing with a service processor that is embedded in a server platform. The IPMI enables an operating system to obtain information about the system health and control system hardware and directs the BMC to perform appropriate actions to address a problem. You can create an IPMI Over LAN policy to manage the IPMI messages through Cisco Intersight. You can assign these user roles to an IPMI user per session - -## IPMI over LAN Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [IPMI over LAN Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/Ipmioverlan_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [IPMI over LAN Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/Ipmioverlan_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [IPMI over LAN Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightIpmioverlanPolicy.md) properties reference \ No newline at end of file +Defines the protocols for interfacing with a service processor that is embedded in a server platform. The IPMI enables an operating system to obtain information about the system health and control system hardware and directs the BMC to perform appropriate actions to address a problem. You can create an IPMI Over LAN policy to manage the IPMI messages through Cisco Intersight. You can assign these user roles to an IPMI user per session \ No newline at end of file diff --git a/ucs_server/management/local_user_policy/python/local_user_policy.py b/ucs_server/management/local_user_policy/python/local_user_policy.py deleted file mode 100644 index fe89cc8..0000000 --- a/ucs_server/management/local_user_policy/python/local_user_policy.py +++ /dev/null @@ -1,57 +0,0 @@ -from authentication.python import intersight_authentication as client - -from intersight.model.organization_organization_relationship import OrganizationOrganizationRelationship -from intersight.model.iam_end_point_user_policy import IamEndPointUserPolicy -from intersight.model.iam_end_point_password_properties import IamEndPointPasswordProperties -from intersight.api import iam_api -import intersight - -from pprint import pprint -import sys - - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_organization(): - # Creating an instance of organization - return OrganizationOrganizationRelationship(class_id="mo.MoRef", - object_type="organization.Organization") - - -def create_end_point_user_policy(): - api_instance = iam_api.IamApi(api_client) - - # Create an instance of organization and password policy. - organization = create_organization() - password_property = IamEndPointPasswordProperties(class_id="iam.EndPointPasswordProperties", - password_history=5, - enable_password_expiry=False, - enforce_strong_password=True, - force_send_password=False) - - # IamEndPointUserPolicy | The 'iam.EndPointUserPolicy' resource to create. - user_policy = IamEndPointUserPolicy() - - # Setting all the attributes for user_policy instance. - user_policy.name = "sample_user_policy1" - user_policy.description = "sample end point user policy." - user_policy.organization = organization - user_policy.password_properties = password_property - - try: - # Create a 'iam.EndPointUserPolicy' resource. - resp_user_policy = api_instance.create_iam_end_point_user_policy(user_policy) - pprint(resp_user_policy) - return resp_user_policy - except intersight.ApiException as e: - print("Exception when calling IamApi->create_end_point_user_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # # Trigger creation of end point user policy - create_end_point_user_policy() \ No newline at end of file diff --git a/ucs_server/management/local_user_policy/readme.md b/ucs_server/management/local_user_policy/readme.md deleted file mode 100644 index 051a57d..0000000 --- a/ucs_server/management/local_user_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Local User Policy -Automates the configuration of local user preferences. You can create one or more Local User policies which contain a list of local users that need to be configured. - -## Local User Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Local User Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/iam_end_point_user_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Local User Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/iam_end_point_user_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Local User Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightIamEndPointUserPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/management/serial_over_lan_policy/readme.md b/ucs_server/management/serial_over_lan_policy/readme.md deleted file mode 100644 index cfbde4e..0000000 --- a/ucs_server/management/serial_over_lan_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## SOL Policy -Enables the input and output of the serial port of a managed system to be redirected over IP. You can create one or more Serial over LAN policies which contain a specific grouping of Serial over LAN attributes that match the needs of a server or a set of servers. - -## SOL Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [SOL Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/sol_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [SOL Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/sol_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [SOL Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightSolPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/management/snmp_policy/readme.md b/ucs_server/management/snmp_policy/readme.md deleted file mode 100644 index 752bd2b..0000000 --- a/ucs_server/management/snmp_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Simple Network Management Protocol (SNMP) Policy -Configures the SNMP settings for sending fault and alert information by SNMP traps from the managed devices. Any existing SNMP Users or SNMP Traps configured previously on the managed devices are removed and replaced with users or traps that you configure in this policy. If you have not added any users or traps in the policy, the existing users or traps on the server are removed but not replaced. - -## Snmp Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [SNMP Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/snmp_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [SNMP Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/snmp_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [SNMP Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightSnmpPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/management/syslog_policy/readme.md b/ucs_server/management/syslog_policy/readme.md deleted file mode 100644 index dea5e42..0000000 --- a/ucs_server/management/syslog_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Syslog Policy -Defines the logging level (minimum severity) to report for a log file collected from an endpoint, the target destination to store the Syslog messages, and the Hostname/IP Address, port information, and communication protocol for the Remote Logging Server(s). - -## Syslog Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Syslog Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/syslog_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Syslog Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/syslog_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Syslog Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightSyslogPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/management/virtual_kvm_policy/readme.md b/ucs_server/management/virtual_kvm_policy/readme.md deleted file mode 100644 index 4a42c01..0000000 --- a/ucs_server/management/virtual_kvm_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Virtual KVM -Enables specific grouping of virtual KVM properties. This policy lets you specify the number of allowed concurrent KVM sessions, port information, and video encryption options. - -## Virtual KVM Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Virtual KVM Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/kvm_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Virtual KVM Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/kvm_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Virtual KVM Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightKvmPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/misc/ldap_policy/python/ldap_policy.py b/ucs_server/misc/ldap_policy/python/ldap_policy.py deleted file mode 100644 index c683d03..0000000 --- a/ucs_server/misc/ldap_policy/python/ldap_policy.py +++ /dev/null @@ -1,49 +0,0 @@ -import intersight -import sys - -from authentication.python import intersight_authentication as client -from intersight.api import iam_api -from intersight.model.iam_ldap_policy import IamLdapPolicy -from intersight.model.iam_ldap_base_properties import IamLdapBaseProperties - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def iam_ldap_base_properties(): - # IamLdapBaseProperties | The 'IamLdapBaseProperties' resource to create. - base_prop = IamLdapBaseProperties() - # Setting all the attributes for base_prop instance. - base_prop.BaseDn = "intersight" - base_prop.Domain = "cisco.com" - base_prop.Timeout = 60 - base_prop.EnableEncryption = False - base_prop.BindMethod = "LoginCredentials" - base_prop.Filter = "cisco" - base_prop.GroupAttribute = "intersight" - base_prop.Attribute = "test" - base_prop.EnableGroupAuthorization = False - base_prop.NestedGroupSearchDepth = 128 - return base_prop - - -def create_ldap_policy(): - # Create an instance of the API class. - api_instance = iam_api.IamApi(api_client) - base_prop = iam_ldap_base_properties() - # IamLdapPolicy | The 'IamLdap.Policy' resource to create. - iam_ldap_pol1 = IamLdapPolicy(name="sample_ldap_policy", base_properties=base_prop, EnableDns=False) - try: - # Create a 'IamLdap.Policy' resource. - api_response1 = api_instance.create_iam_ldap_policy(iam_ldap_pol1) - print(api_response1) - except intersight.ApiException as e: - print("Exception when calling IamApi->create_iam_ldap_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of ldap policy - create_ldap_policy() diff --git a/ucs_server/misc/ldap_policy/readme.md b/ucs_server/misc/ldap_policy/readme.md deleted file mode 100644 index 5ed72d6..0000000 --- a/ucs_server/misc/ldap_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## LDAP Policy -Specifies the LDAP configuration settings and preferences for an endpoint. The endpoints support LDAP to store and maintain directory information in a network. The LDAP policy determines configuration settings for LDAP Servers, DNS parameters including options to obtain a domain name used for the DNS SRV request, Binding methods, Search parameters, and Group Authorization preferences. Through an LDAP policy, you can also create multiple LDAP groups and add them to the LDAP server database. - -## LDAP Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [LDAP Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/iam_ldap_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [LDAP Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/iam_ldap_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [LDAP Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightIamLdapPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/misc/ntp_policy/readme.md b/ucs_server/misc/ntp_policy/readme.md deleted file mode 100644 index 07a46ea..0000000 --- a/ucs_server/misc/ntp_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## NTP Policy -Allows you to enable the NTP service on an Intersight Managed Cisco IMC (Standalone) server. The NTP service synchronizes the time with an NTP server. You must enable and configure the NTP service by specifying the IP address or DNS of a minimum of one to a maximum of four NTP servers. - -## Ntp Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Ntp Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/ntp_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Ntp Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/ntp_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Ntp Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightNtpPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/misc/smtp_policy/python/smtp_policy.py b/ucs_server/misc/smtp_policy/python/smtp_policy.py deleted file mode 100644 index fe84e01..0000000 --- a/ucs_server/misc/smtp_policy/python/smtp_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -import intersight -import sys - -from authentication.python import intersight_authentication as client -from intersight.api import smtp_api -from intersight.model.smtp_policy import SmtpPolicy - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_smtp_policy(): - # Create an instance of the API class. - api_instance = smtp_api.SmtpApi(api_client) - # SmtpPolicy | The 'Smtp.Policy' resource to create. - smtp_pol = SmtpPolicy(name="sample_smtp", smtp_server="samplesmtp.intersight.com") - try: - # Create a 'Smtp.Policy' resource. - api_response = api_instance.create_smtp_policy(smtp_pol) - print(api_response) - except intersight.ApiException as e: - print("Exception when calling SmtpApi->create_smtp_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of smtp policy - create_smtp_policy() diff --git a/ucs_server/misc/smtp_policy/readme.md b/ucs_server/misc/smtp_policy/readme.md deleted file mode 100644 index 6276953..0000000 --- a/ucs_server/misc/smtp_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## SMTP Policy -Sets the state of the SMTP client in the managed device. You can specify the preferred settings for outgoing communication and select the fault severity level to report and the mail recipients. - -## SMTP Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [SMTP Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/smtp_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [SMTP Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/smtp_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [SMTP Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightSmtpPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/misc/ssh_policy/readme.md b/ucs_server/misc/ssh_policy/readme.md deleted file mode 100644 index caef537..0000000 --- a/ucs_server/misc/ssh_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## SSH Policy -Enables an SSH client to make a secure, encrypted connection. You can create one or more SSH policies that contain a specific grouping of SSH properties for a server or a set of servers. - -## SSH Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [SSH Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/ssh_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [SSH Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/ssh_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [SSH Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightSshPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/network/adapter_configuation_policy/readme.md b/ucs_server/network/adapter_configuation_policy/readme.md deleted file mode 100644 index 5f71923..0000000 --- a/ucs_server/network/adapter_configuation_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## Adapter Configuration Policy -Configures the Ethernet and Fibre-Channel settings for the VIC adapter. - -## Adapter Configuration Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Adapter Configuration Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/adapter_config_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Adapter Configuration Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/adapter_config_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Adapter Configuration Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightAdapterConfigPolicy.md) properties reference - diff --git a/ucs_server/network/ethernet_adapter_policy/python/ethernet_adapter_policy.py b/ucs_server/network/ethernet_adapter_policy/python/ethernet_adapter_policy.py deleted file mode 100644 index 4a10301..0000000 --- a/ucs_server/network/ethernet_adapter_policy/python/ethernet_adapter_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -import intersight -import sys - -from authentication.python import intersight_authentication as client -from intersight.api import vnic_api -from intersight.model.vnic_eth_adapter_policy import VnicEthAdapterPolicy - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_ethernet_adapter_policy(): - # Create an instance of the API class. - api_instance = vnic_api.VnicApi(api_client) - # VnicEthAdapterPolicy | The 'VnicEthAdapter.Policy' resource to create. - vnic_eth_adapter_policy = VnicEthAdapterPolicy(name="sample_ethernet_adapter_policy") - try: - # Create a 'VnicEthAdapter.Policy' resource. - api_response = api_instance.create_vnic_eth_adapter_policy(vnic_eth_adapter_policy) - print(api_response) - except intersight.ApiException as e: - print("Exception when calling VnicApi->create_vnic_eth_adapter_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of ethernet adapter policy - create_ethernet_adapter_policy() diff --git a/ucs_server/network/ethernet_adapter_policy/readme.md b/ucs_server/network/ethernet_adapter_policy/readme.md deleted file mode 100644 index ba4beb5..0000000 --- a/ucs_server/network/ethernet_adapter_policy/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -## Ethernet Adapter Policy -Governs the host-side behavior of the adapter, including how the adapter handles traffic. For each VIC Virtual Ethernet Interface, you can configure various features like VXLAN, NVGRE, ARFS, Interrupt settings, and TCP Offload settings. - -This policy includes the recommended default configurations for the supported server operating systems. The policy supports 16 default configurations. During the policy creation, you can select and import a default configuration. - -## Ethernet Adapter Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Ethernet Adapter Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_eth_network_control_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Ethernet Adapter Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_eth_network_control_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Ethernet Adapter Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricEthNetworkControlPolicy.md) properties reference - - diff --git a/ucs_server/network/ethernet_network_control_policy/readme.md b/ucs_server/network/ethernet_network_control_policy/readme.md deleted file mode 100644 index afd2239..0000000 --- a/ucs_server/network/ethernet_network_control_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Ethernet Network Control Policy -Configures the network control settings for the appliance ports, port channels, or vNICs. - -## Ethernet Network Control Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Ethernet Network Control Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_eth_adapter_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Ethernet Network Control Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_eth_adapter_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Ethernet Network Controlr Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicEthAdapterPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/network/ethernet_network_group_policy/readme.md b/ucs_server/network/ethernet_network_group_policy/readme.md deleted file mode 100644 index 5dde885..0000000 --- a/ucs_server/network/ethernet_network_group_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## Ethernet Network Group Policy -Configures the allowed VLAN and native VLAN for the appliance ports, port channels, or vNICs. - -## Ethernet Network Group Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Ethernet Network Group Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/fabric_eth_network_group_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Ethernet Network Group Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/fabric_eth_network_group_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Ethernet Network Group Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightFabricEthNetworkGroupPolicy.md) properties reference - diff --git a/ucs_server/network/ethernet_network_policy/readme.md b/ucs_server/network/ethernet_network_policy/readme.md deleted file mode 100644 index faf3c77..0000000 --- a/ucs_server/network/ethernet_network_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## EthernetNetworkPolicy -Determines if the port can carry single VLAN(Access) or multiple VLANs(Trunk) traffic. You can specify the VLAN to be associated with an Ethernet packet if no tag is found. - -## Ethernet Network Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Ethernet Network Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_eth_network_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Ethernet Network Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_eth_network_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Ethernet Network Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicEthNetworkPolicy.md) properties reference diff --git a/ucs_server/network/ethernet_qos_policy/readme.md b/ucs_server/network/ethernet_qos_policy/readme.md deleted file mode 100644 index 6192faa..0000000 --- a/ucs_server/network/ethernet_qos_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Ethernet QoS Policy -Assigns a system class to the outgoing traffic for a vNIC. This system class determines the quality of service for the outgoing traffic. For certain adapters, you can also specify additional controls like burst and rate on the outgoing traffic. - -## Ethernet QoS Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Ethernet QoS Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_eth_qos_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Ethernet QoS Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_eth_qos_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Ethernet QoS Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicEthQosPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/network/lan_connectivity_policy/python/lan_connectivity_policy.py b/ucs_server/network/lan_connectivity_policy/python/lan_connectivity_policy.py deleted file mode 100644 index 970ea75..0000000 --- a/ucs_server/network/lan_connectivity_policy/python/lan_connectivity_policy.py +++ /dev/null @@ -1,31 +0,0 @@ -import intersight -import sys - -from authentication.python import intersight_authentication as client -from intersight.api import vnic_api -from intersight.model.vnic_lan_connectivity_policy import VnicLanConnectivityPolicy - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_lan_connectivity_policy(): - # Create an instance of the API class. - api_instance = vnic_api.VnicApi(api_client) - - # Create lan connectivity policy - vnic_lan_cnn_pol1 = VnicLanConnectivityPolicy(name="sample_lan_policy1") - try: - # Create a 'VnicLanConnectivity.Policy' resource. - api_response1 = api_instance.create_vnic_lan_connectivity_policy(vnic_lan_cnn_pol1) - print(api_response1) - except intersight.ApiException as e: - print("Exception when calling VnicApi->create_vnic_lan_connectivity_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of lan connectivity policy - create_lan_connectivity_policy() diff --git a/ucs_server/network/lan_connectivity_policy/readme.md b/ucs_server/network/lan_connectivity_policy/readme.md deleted file mode 100644 index 2982021..0000000 --- a/ucs_server/network/lan_connectivity_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## LAN Connectivity Policy -Determines the connections and the network communication resources between the server and the LAN on the network. You must create the Ethernet Adapter, Ethernet QoS, and Ethernet Network policies as part of the LAN connectivity policy. For IMM servers, use a MAC pool, or static MAC addresses, to assign MAC addresses to servers and to identify the vNICs that the servers use to communicate with the network - -## LAN Connectivity Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [LAN Connectivity Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_lan_connectivity_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [LAN Connectivity Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_lan_connectivity_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [LAN Connectivity Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicLanConnectivityPolicy.md) properties reference - diff --git a/ucs_server/network/netwrok_connectivity_policy/python/netwrok_connectivity_policy.py b/ucs_server/network/netwrok_connectivity_policy/python/netwrok_connectivity_policy.py deleted file mode 100644 index d738a67..0000000 --- a/ucs_server/network/netwrok_connectivity_policy/python/netwrok_connectivity_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -import intersight -import sys - -from authentication.python import intersight_authentication as client -from intersight.api import networkconfig_api -from intersight.model.networkconfig_policy import NetworkconfigPolicy - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_network_connectivity_policy(): - # Create an instance of the API class. - api_instance = networkconfig_api.NetworkconfigApi(api_client) - # NetworkconfigPolicy | The 'Networkconfig.Policy' resource to create. - vnic_lan_cnn_pol1 = NetworkconfigPolicy(name="sample_network_config_policy") - try: - # Create a 'Networkconfig.Policy' resource. - api_response1 = api_instance.create_networkconfig_policy(vnic_lan_cnn_pol1) - print(api_response1) - except intersight.ApiException as e: - print("Exception when calling networkconfig_api->create_networkconfig_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of network config policy - create_network_connectivity_policy() diff --git a/ucs_server/network/netwrok_connectivity_policy/readme.md b/ucs_server/network/netwrok_connectivity_policy/readme.md deleted file mode 100644 index 869481d..0000000 --- a/ucs_server/network/netwrok_connectivity_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Network Connectivity Policy -Specifies the DNS Domain settings that are used to add or update the resource records on the DNS server from the endpoints, and the DNS server settings for IPv4 and IPv6 on an endpoint. - -## Network Connectivity Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Network Connectivity Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/networkconfig_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Network Connectivity Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/networkconfig_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Network Connectivity Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightNetworkconfigPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/network/san_connectivity_policy/readme.md b/ucs_server/network/san_connectivity_policy/readme.md deleted file mode 100644 index ca29d11..0000000 --- a/ucs_server/network/san_connectivity_policy/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -## SAN Connectivity Policy -Determines the network storage resources and the connections between the server and the SAN on the network. This policy enables you to configure vHBAs that the servers use to communicate with the Storage Area Network. You can use WWPN and WWNN address pools, or static WWPN and WWNN addresses, to add vHBAs and to configure them. You must create the Fibre Channel Adapter, Fibre Channel QoS, and Fibre Channel Network policies as part of the SAN connectivity policy. - - -## SAN Connectivity Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [SAN Connectivity Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_san_connectivity_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [SAN Connectivity Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_san_connectivity_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [SAN Connectivity Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicSanConnectivityPolicy.md) properties reference - diff --git a/ucs_server/storage/fiber_channel_adapter_policy/python/fiber_channel_adapter_policy.py b/ucs_server/storage/fiber_channel_adapter_policy/python/fiber_channel_adapter_policy.py deleted file mode 100644 index bae47c0..0000000 --- a/ucs_server/storage/fiber_channel_adapter_policy/python/fiber_channel_adapter_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -import intersight -import sys - -from authentication.python import intersight_authentication as client -from intersight.api import vnic_api -from intersight.model.vnic_fc_adapter_policy import VnicFcAdapterPolicy - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_fiber_channel_adapter_policy(): - # Create an instance of the API class. - api_instance = vnic_api.VnicApi(api_client) - # VnicFcAdapterPolicy | The 'VnicFcAdapter.Policy' resource to create. - fc_adap_pol = VnicFcAdapterPolicy(name="sample_fiber_channel_adapter_policy") - try: - # Create a 'VnicFcAdapter.Policy' resource. - api_response = api_instance.create_vnic_fc_adapter_policy(fc_adap_pol) - print(api_response) - except intersight.ApiException as e: - print("Exception when calling VnicApi->create_vnic_fc_adapter_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of fiber channel adapter policy - create_fiber_channel_adapter_policy() diff --git a/ucs_server/storage/fiber_channel_adapter_policy/readme.md b/ucs_server/storage/fiber_channel_adapter_policy/readme.md deleted file mode 100644 index ef85f2e..0000000 --- a/ucs_server/storage/fiber_channel_adapter_policy/readme.md +++ /dev/null @@ -1,12 +0,0 @@ -## Fiber Channel Adapter Policy -Governs the host-side behavior of the adapter, including how the adapter handles traffic. You can enable FCP Error Recovery, change the default settings of Queues, and Interrupt handling for performance enhancement. - -This policy includes the recommended default configurations for the supported server operating systems. The policy supports nine default configurations. During the policy creation, you can select and import a default configuration. -## Fiber Channel Adapter Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Fiber Channel Adapter Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_fc_adapter_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Fiber Channel Adapter Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_fc_adapter_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Fiber Channel Adapter Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicFcAdapterPolicy.md) properties reference - - diff --git a/ucs_server/storage/fiber_channel_network_policy/readme.md b/ucs_server/storage/fiber_channel_network_policy/readme.md deleted file mode 100644 index 63dd2f9..0000000 --- a/ucs_server/storage/fiber_channel_network_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Fiber Channel Network Policy -Governs the VSAN configuration for the virtual interfaces. - -## Fiber Channel Network Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Fiber Channel Network Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_fc_network_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Fiber Channel Network Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_fc_network_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Fiber Channel Network Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicFcNetworkPolicy.md) properties reference diff --git a/ucs_server/storage/fiber_channel_qos_policy/readme.md b/ucs_server/storage/fiber_channel_qos_policy/readme.md deleted file mode 100644 index ce0e03b..0000000 --- a/ucs_server/storage/fiber_channel_qos_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## Fibre Channel QoS Policy -Assigns a system class to the outgoing traffic for a vHBA. This system class determines the quality of service for the outgoing traffic. For certain adapters, you can also specify additional controls like burst and rate on the outgoing traffic. - - -## Fiber Channel QoS Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Fiber Channel QoS Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_fc_qos_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Fiber Channel QoS Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_fc_qos_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Fiber Channel QoS Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicFcQosPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/storage/iscsi_adapter_policy/readme.md b/ucs_server/storage/iscsi_adapter_policy/readme.md deleted file mode 100644 index 3b79dd9..0000000 --- a/ucs_server/storage/iscsi_adapter_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Iscsi Adapter Policy -The iSCSI Adapter policy allows you to configure values for TCP Connection Timeout, DHCP Timeout, and the Retry Count if the specified LUN ID is busy. -## Iscsi Adapter Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Iscsi Adapter Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_iscsi_adapter_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Iscsi Adapter Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_iscsi_adapter_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Iscsi Adapter Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicIscsiAdapterPolicy.md) properties reference - diff --git a/ucs_server/storage/iscsi_boot_policy/readme.md b/ucs_server/storage/iscsi_boot_policy/readme.md deleted file mode 100644 index cb216f5..0000000 --- a/ucs_server/storage/iscsi_boot_policy/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -## Iscsi Boot Policy -iSCSI boot support allows you to initialize the Operating System on FI-attached blade and rack servers from a remote disk across a Storage Area Network. -## Iscsi Boot Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Iscsi Boot Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_iscsi_boot_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Iscsi Boot Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_iscsi_boot_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Iscsi Boot Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicIscsiBootPolicy.md) properties reference diff --git a/ucs_server/storage/iscsi_static_target_policy/readme.md b/ucs_server/storage/iscsi_static_target_policy/readme.md deleted file mode 100644 index 0a33c71..0000000 --- a/ucs_server/storage/iscsi_static_target_policy/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## ISCSI Static Target Policy -he iSCSI Static Target policy allows you to specify the name, IP address, port, and logical unit number of the primary target for iSCSI boot. You can optionally specify these details for a secondary target as well. - -## Iscsi Static Target Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Iscsi Static Target Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/vnic_iscsi_static_target_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Iscsi Static Target Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/vnic_iscsi_static_target_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Iscsi Static Target Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightVnicIscsiStaticTargetPolicy.md) properties reference - diff --git a/ucs_server/storage/sd_card_policy/python/sd_card_policy.py b/ucs_server/storage/sd_card_policy/python/sd_card_policy.py deleted file mode 100644 index c8e9acb..0000000 --- a/ucs_server/storage/sd_card_policy/python/sd_card_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -import intersight -import sys - -from authentication.python import intersight_authentication as client -from intersight.api import sdcard_api -from intersight.model.sdcard_policy import SdcardPolicy - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_sd_card_policy(): - # Create an instance of the API class. - api_instance = sdcard_api.SdcardApi(api_client) - # SdcardPolicy | The 'Sdcard.Policy' resource to create. - sd_card_pol = SdcardPolicy(name="sample_sd_card_policy") - try: - # Create a 'Sdcard.Policy' resource. - api_response = api_instance.create_sdcard_policy(sd_card_pol) - print(api_response) - except intersight.ApiException as e: - print("Exception when calling SdcardApi->create_sdcard_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of sd card policy - create_sd_card_policy() diff --git a/ucs_server/storage/sd_card_policy/readme.md b/ucs_server/storage/sd_card_policy/readme.md deleted file mode 100644 index 06c439b..0000000 --- a/ucs_server/storage/sd_card_policy/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -## SD Card Policy -Configures the Cisco FlexFlash and FlexUtil Secure Digital (SD) cards for the Cisco UCS C-Series Standalone M4 and M5 servers. This policy specifies details of virtual drives on the SD cards. You can configure the SD cards in the Operating System Only, Utility Only, or Operating System + Utility modes. -When two cards are present in the Cisco FlexFlash controller and Operating System is chosen in the SD card policy, the configured OS partition is mirrored. If only single card is available in the Cisco FlexFlash controller, the configured OS partition is non-RAID. The utility partitions are always set as non-RAID. - - -## SD Card Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [SD Card Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/sdcard_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [SD Card Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/sdcard_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [SD Card Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightSdcardPolicy.md) properties reference \ No newline at end of file diff --git a/ucs_server/storage/storage_policy/python/storage_policy.py b/ucs_server/storage/storage_policy/python/storage_policy.py deleted file mode 100644 index 4b0a478..0000000 --- a/ucs_server/storage/storage_policy/python/storage_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -import intersight -import sys - -from authentication.python import intersight_authentication as client -from intersight.api import storage_api -from intersight.model.storage_storage_policy import StorageStoragePolicy - -api_key = "api_key" -api_key_file = "~/api_key_file_path" - -api_client = client.get_api_client(api_key, api_key_file) - - -def create_storage_policy(): - # Create an instance of the API class. - api_instance = storage_api.StorageApi(api_client) - # StorageStoragePolicy | The 'StorageStorage.Policy' resource to create. - storage_pol = StorageStoragePolicy(name="sample_storage_policy") - try: - # Create a 'StorageStorage.Policy' resource. - api_response = api_instance.create_storage_storage_policy(storage_pol) - print(api_response) - except intersight.ApiException as e: - print("Exception when calling StorageApi->create_storage_storage_policy: %s\n" % e) - sys.exit(1) - - -if __name__ == "__main__": - # Trigger creation of storage policy - create_storage_policy() diff --git a/ucs_server/storage/storage_policy/readme.md b/ucs_server/storage/storage_policy/readme.md deleted file mode 100644 index 18c07e8..0000000 --- a/ucs_server/storage/storage_policy/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Storage Policy -Allows you to create drive groups and virtual drives, configure the storage capacity of a virtual drive, and configure the M.2 RAID controllers. - -## Storage Policy Properties reference -| SKDs | Properties Description -| ---- | ------------------- | -| [python](https://github.com/CiscoDevNet/intersight-python/) | [Storage Policy](https://github.com/CiscoDevNet/intersight-python/tree/main/intersight/model/storage_storage_policy.py) properties reference | | -| [terraform](https://github.com/CiscoDevNet/terraform-provider-intersight/) | [Storage Policy](https://registry.terraform.io/providers/CiscoDevNet/intersight/latest/docs/resources/storage_storage_policy) properties reference | -| [powershell](https://github.com/CiscoDevNet/intersight-powershell/) | [Storage Policy](https://github.com/CiscoDevNet/intersight-powershell/blob/main/docs/New-IntersightStorageStoragePolicy.md) properties reference \ No newline at end of file