<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ONTAP CIFS service delete with Python client library 9.7 in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-CIFS-service-delete-with-Python-client-library-9-7/m-p/154995#M39</link>
    <description>&lt;P&gt;I am going crazy. Can anybody tell me the secret of deleting a CIFS server with Python client library? It complains about missing AD credentials, but I am simply not getting how to pass them over. I am working in LoD:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://handsonlabs.netapp.com/lab/ontapapi" target="_blank"&gt;https://handsonlabs.netapp.com/lab/ontapapi&lt;/A&gt;&amp;nbsp;(&lt;SPAN&gt;SL10599)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is what I am trying to do:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;print("--&amp;gt; Starting CIFS server delete operation")
try:
	cifs = CifsService.find(name="PRIMARY_SVM_01")
	cifs.from_dict(
	{
	  "svm": {
	    "name": "primary_svm_01"
	  },
	  "ad_domain": {
	    "fqdn": "demo.netapp.com",
	    "user": "Administrator@demo.netapp.com", 
	    "password": "&amp;lt;guesswhatthatcouldbe:D&amp;gt;"
	  }
	})
	cifs.delete()
	print("--&amp;gt; CIFS server {} deleted successfully".format(cifs.name))
except NetAppRestError as err:
	print("--&amp;gt; Error: CIFS server was not deleted:\n{}".format(err))
print("")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here is the debug output:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;‌--&amp;gt; Starting CIFS server delete operation
DEBUG:urllib3.util.retry:Converted retries value: 5 -&amp;gt; Retry(total=5, connect=None, read=None, redirect=None, status=None)
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cluster1.demo.netapp.com:443
DEBUG:urllib3.connectionpool:https://cluster1.demo.netapp.com:443 "GET /api/protocols/cifs/services?name=PRIMARY_SVM_01 HTTP/1.1" 200 579
DEBUG:netapp_ontap.utils:
-----------REQUEST-----------
GET https://cluster1.demo.netapp.com:443/api/protocols/cifs/services?name=PRIMARY_SVM_01
User-Agent: python-requests/2.23.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
X-Dot-Client-App: netapp-ontap-python-9.7.0
Authorization: Basic YWRtaW46TmV0YXBwMSE=
None
-----------------------------

-----------RESPONSE-----------
200 OK
Date: Wed, 18 Mar 2020 06:45:40 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 579
Content-Type: application/hal+json
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
{
  "records": [
    {
      "svm": {
        "uuid": "513ab210-687a-11ea-8d2a-005056819f1b",
        "name": "primary_svm_01",
        "_links": {
          "self": {
            "href": "/api/svm/svms/513ab210-687a-11ea-8d2a-005056819f1b"
          }
        }
      },
      "name": "PRIMARY_SVM_01",
      "_links": {
        "self": {
          "href": "/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b"
        }
      }
    }
  ],
  "num_records": 1,
  "_links": {
    "self": {
      "href": "/api/protocols/cifs/services?name=PRIMARY_SVM_01"
    }
  }
}
------------------------------
DEBUG:urllib3.util.retry:Converted retries value: 5 -&amp;gt; Retry(total=5, connect=None, read=None, redirect=None, status=None)
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cluster1.demo.netapp.com:443
DEBUG:urllib3.connectionpool:https://cluster1.demo.netapp.com:443 "GET /api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b HTTP/1.1" 200 768
DEBUG:netapp_ontap.utils:
-----------REQUEST-----------
GET https://cluster1.demo.netapp.com:443/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b
User-Agent: python-requests/2.23.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
X-Dot-Client-App: netapp-ontap-python-9.7.0
Authorization: Basic YWRtaW46TmV0YXBwMSE=
None
-----------------------------

-----------RESPONSE-----------
200 OK
Date: Wed, 18 Mar 2020 06:45:40 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 768
Content-Type: application/hal+json
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
{
  "svm": {
    "uuid": "513ab210-687a-11ea-8d2a-005056819f1b",
    "name": "primary_svm_01",
    "_links": {
      "self": {
        "href": "/api/svm/svms/513ab210-687a-11ea-8d2a-005056819f1b"
      }
    }
  },
  "name": "PRIMARY_SVM_01",
  "ad_domain": {
    "fqdn": "DEMO.NETAPP.COM",
    "organizational_unit": "CN=Computers"
  },
  "enabled": true,
  "comment": "Created with ONTAP PYL",
  "security": {
    "restrict_anonymous": "no_enumeration",
    "smb_signing": false,
    "smb_encryption": false,
    "kdc_encryption": false
  },
  "netbios": {
    "wins_servers": [
    ],
    "enabled": false
  },
  "default_unix_user": "pcuser",
  "_links": {
    "self": {
      "href": "/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b"
    }
  }
}
------------------------------
DEBUG:netapp_ontap.utils:
-----------REQUEST-----------
GET https://cluster1.demo.netapp.com:443/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b
User-Agent: python-requests/2.23.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
X-Dot-Client-App: netapp-ontap-python-9.7.0
Authorization: Basic YWRtaW46TmV0YXBwMSE=
None
-----------------------------

-----------RESPONSE-----------
200 OK
Date: Wed, 18 Mar 2020 06:45:40 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 768
Content-Type: application/hal+json
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
{
  "svm": {
    "uuid": "513ab210-687a-11ea-8d2a-005056819f1b",
    "name": "primary_svm_01",
    "_links": {
      "self": {
        "href": "/api/svm/svms/513ab210-687a-11ea-8d2a-005056819f1b"
      }
    }
  },
  "name": "PRIMARY_SVM_01",
  "ad_domain": {
    "fqdn": "DEMO.NETAPP.COM",
    "organizational_unit": "CN=Computers"
  },
  "enabled": true,
  "comment": "Created with ONTAP PYL",
  "security": {
    "restrict_anonymous": "no_enumeration",
    "smb_signing": false,
    "smb_encryption": false,
    "kdc_encryption": false
  },
  "netbios": {
    "wins_servers": [
    ],
    "enabled": false
  },
  "default_unix_user": "pcuser",
  "_links": {
    "self": {
      "href": "/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b"
    }
  }
}
------------------------------
DEBUG:urllib3.connectionpool:https://cluster1.demo.netapp.com:443 "DELETE /api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b HTTP/1.1" 202 189
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cluster1.demo.netapp.com:443
DEBUG:urllib3.connectionpool:https://cluster1.demo.netapp.com:443 "GET /api/cluster/jobs/154221a4-68e4-11ea-87e9-00505681f8b5 HTTP/1.1" 200 619
INFO:netapp_ontap.utils:Job (failure): In order to delete an Active Directory machine account for the CIFS server, you must supply the name and password of a Windows account with sufficient privileges to remove computers from the "DEMO.NETAPP.COM" domain. . Timeout remaining: 30.
--&amp;gt; Error: CIFS server was not deleted:
Job failed: In order to delete an Active Directory machine account for the CIFS server, you must supply the name and password of a Windows account with sufficient privileges to remove computers from the "DEMO.NETAPP.COM" domain.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 11:15:58 GMT</pubDate>
    <dc:creator>badrian</dc:creator>
    <dc:date>2025-06-04T11:15:58Z</dc:date>
    <item>
      <title>ONTAP CIFS service delete with Python client library 9.7</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-CIFS-service-delete-with-Python-client-library-9-7/m-p/154995#M39</link>
      <description>&lt;P&gt;I am going crazy. Can anybody tell me the secret of deleting a CIFS server with Python client library? It complains about missing AD credentials, but I am simply not getting how to pass them over. I am working in LoD:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://handsonlabs.netapp.com/lab/ontapapi" target="_blank"&gt;https://handsonlabs.netapp.com/lab/ontapapi&lt;/A&gt;&amp;nbsp;(&lt;SPAN&gt;SL10599)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is what I am trying to do:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;print("--&amp;gt; Starting CIFS server delete operation")
try:
	cifs = CifsService.find(name="PRIMARY_SVM_01")
	cifs.from_dict(
	{
	  "svm": {
	    "name": "primary_svm_01"
	  },
	  "ad_domain": {
	    "fqdn": "demo.netapp.com",
	    "user": "Administrator@demo.netapp.com", 
	    "password": "&amp;lt;guesswhatthatcouldbe:D&amp;gt;"
	  }
	})
	cifs.delete()
	print("--&amp;gt; CIFS server {} deleted successfully".format(cifs.name))
except NetAppRestError as err:
	print("--&amp;gt; Error: CIFS server was not deleted:\n{}".format(err))
print("")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here is the debug output:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;‌--&amp;gt; Starting CIFS server delete operation
DEBUG:urllib3.util.retry:Converted retries value: 5 -&amp;gt; Retry(total=5, connect=None, read=None, redirect=None, status=None)
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cluster1.demo.netapp.com:443
DEBUG:urllib3.connectionpool:https://cluster1.demo.netapp.com:443 "GET /api/protocols/cifs/services?name=PRIMARY_SVM_01 HTTP/1.1" 200 579
DEBUG:netapp_ontap.utils:
-----------REQUEST-----------
GET https://cluster1.demo.netapp.com:443/api/protocols/cifs/services?name=PRIMARY_SVM_01
User-Agent: python-requests/2.23.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
X-Dot-Client-App: netapp-ontap-python-9.7.0
Authorization: Basic YWRtaW46TmV0YXBwMSE=
None
-----------------------------

-----------RESPONSE-----------
200 OK
Date: Wed, 18 Mar 2020 06:45:40 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 579
Content-Type: application/hal+json
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
{
  "records": [
    {
      "svm": {
        "uuid": "513ab210-687a-11ea-8d2a-005056819f1b",
        "name": "primary_svm_01",
        "_links": {
          "self": {
            "href": "/api/svm/svms/513ab210-687a-11ea-8d2a-005056819f1b"
          }
        }
      },
      "name": "PRIMARY_SVM_01",
      "_links": {
        "self": {
          "href": "/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b"
        }
      }
    }
  ],
  "num_records": 1,
  "_links": {
    "self": {
      "href": "/api/protocols/cifs/services?name=PRIMARY_SVM_01"
    }
  }
}
------------------------------
DEBUG:urllib3.util.retry:Converted retries value: 5 -&amp;gt; Retry(total=5, connect=None, read=None, redirect=None, status=None)
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cluster1.demo.netapp.com:443
DEBUG:urllib3.connectionpool:https://cluster1.demo.netapp.com:443 "GET /api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b HTTP/1.1" 200 768
DEBUG:netapp_ontap.utils:
-----------REQUEST-----------
GET https://cluster1.demo.netapp.com:443/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b
User-Agent: python-requests/2.23.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
X-Dot-Client-App: netapp-ontap-python-9.7.0
Authorization: Basic YWRtaW46TmV0YXBwMSE=
None
-----------------------------

-----------RESPONSE-----------
200 OK
Date: Wed, 18 Mar 2020 06:45:40 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 768
Content-Type: application/hal+json
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
{
  "svm": {
    "uuid": "513ab210-687a-11ea-8d2a-005056819f1b",
    "name": "primary_svm_01",
    "_links": {
      "self": {
        "href": "/api/svm/svms/513ab210-687a-11ea-8d2a-005056819f1b"
      }
    }
  },
  "name": "PRIMARY_SVM_01",
  "ad_domain": {
    "fqdn": "DEMO.NETAPP.COM",
    "organizational_unit": "CN=Computers"
  },
  "enabled": true,
  "comment": "Created with ONTAP PYL",
  "security": {
    "restrict_anonymous": "no_enumeration",
    "smb_signing": false,
    "smb_encryption": false,
    "kdc_encryption": false
  },
  "netbios": {
    "wins_servers": [
    ],
    "enabled": false
  },
  "default_unix_user": "pcuser",
  "_links": {
    "self": {
      "href": "/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b"
    }
  }
}
------------------------------
DEBUG:netapp_ontap.utils:
-----------REQUEST-----------
GET https://cluster1.demo.netapp.com:443/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b
User-Agent: python-requests/2.23.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
X-Dot-Client-App: netapp-ontap-python-9.7.0
Authorization: Basic YWRtaW46TmV0YXBwMSE=
None
-----------------------------

-----------RESPONSE-----------
200 OK
Date: Wed, 18 Mar 2020 06:45:40 GMT
Server: libzapid-httpd
X-Content-Type-Options: nosniff
Cache-Control: no-cache,no-store,must-revalidate
Content-Length: 768
Content-Type: application/hal+json
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
{
  "svm": {
    "uuid": "513ab210-687a-11ea-8d2a-005056819f1b",
    "name": "primary_svm_01",
    "_links": {
      "self": {
        "href": "/api/svm/svms/513ab210-687a-11ea-8d2a-005056819f1b"
      }
    }
  },
  "name": "PRIMARY_SVM_01",
  "ad_domain": {
    "fqdn": "DEMO.NETAPP.COM",
    "organizational_unit": "CN=Computers"
  },
  "enabled": true,
  "comment": "Created with ONTAP PYL",
  "security": {
    "restrict_anonymous": "no_enumeration",
    "smb_signing": false,
    "smb_encryption": false,
    "kdc_encryption": false
  },
  "netbios": {
    "wins_servers": [
    ],
    "enabled": false
  },
  "default_unix_user": "pcuser",
  "_links": {
    "self": {
      "href": "/api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b"
    }
  }
}
------------------------------
DEBUG:urllib3.connectionpool:https://cluster1.demo.netapp.com:443 "DELETE /api/protocols/cifs/services/513ab210-687a-11ea-8d2a-005056819f1b HTTP/1.1" 202 189
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cluster1.demo.netapp.com:443
DEBUG:urllib3.connectionpool:https://cluster1.demo.netapp.com:443 "GET /api/cluster/jobs/154221a4-68e4-11ea-87e9-00505681f8b5 HTTP/1.1" 200 619
INFO:netapp_ontap.utils:Job (failure): In order to delete an Active Directory machine account for the CIFS server, you must supply the name and password of a Windows account with sufficient privileges to remove computers from the "DEMO.NETAPP.COM" domain. . Timeout remaining: 30.
--&amp;gt; Error: CIFS server was not deleted:
Job failed: In order to delete an Active Directory machine account for the CIFS server, you must supply the name and password of a Windows account with sufficient privileges to remove computers from the "DEMO.NETAPP.COM" domain.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:15:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-CIFS-service-delete-with-Python-client-library-9-7/m-p/154995#M39</guid>
      <dc:creator>badrian</dc:creator>
      <dc:date>2025-06-04T11:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: ONTAP CIFS service delete with Python client library 9.7</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-CIFS-service-delete-with-Python-client-library-9-7/m-p/155032#M40</link>
      <description>&lt;P&gt;The CIFS Services &lt;A href="https://library.netapp.com/ecmdocs/ECMLP2862544/html/index.html#/NAS/cifs_service_delete" target="_self"&gt;DELETE API&lt;/A&gt; requires that the credentials are passed in the body of the request. So your code should look a bit like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;print("--&amp;gt; Starting CIFS server delete operation")
try:
    cifs = CifsService.find(name="PRIMARY_SVM_01")
    cifs.delete(body={
        "ad_domain": {
            "fqdn": "demo.netapp.com",
            "user": "Administrator@demo.netapp.com", 
            "password": "&amp;lt;guesswhatthatcouldbe:D&amp;gt;"
        }
    })
    print("--&amp;gt; CIFS server {} deleted successfully".format(cifs.name))
except NetAppRestError as err:
    print("--&amp;gt; Error: CIFS server was not deleted:\n{}".format(err))
print("")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 12:24:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-CIFS-service-delete-with-Python-client-library-9-7/m-p/155032#M40</guid>
      <dc:creator>RobertBlackhart</dc:creator>
      <dc:date>2020-03-19T12:24:45Z</dc:date>
    </item>
  </channel>
</rss>

