[QUESTION] How am I supposed to enter account name in script?
See original GitHub issueLet’s say that I have an account registered with email ‘Bill.gates@microsoft.com’.
What should I put as parameter when using cf.zones.get
?
I tried different combinations but only if I provide my account ID I’m able to retrieve the zone list.
This is what I expect to work:
def main():
cf = CloudFlare.CloudFlare(profile='Cloudflare')
zones = cf.zones.get(
params={'per_page': 200,
'name': 'Bill.gates@microsoft.com'})
for zone in zones:
zone_name = zone['name']
zone_id = zone['id']
print("id={} - name={}".format(zone_id, zone_name))
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Linux shell script add a user with a password - nixCraft
Enter username : roja Enter password : HIDDEN User has been added to system! Now user roja can login with a password called...
Read more >Issue with user account creation PS script - TechNet - Microsoft
I am having an issue with a script that I have been modifying to create AD accounts from a CSV file that gets...
Read more >how to confirm the user name else allowed to enter a custom ...
Write -Host $firstname = Read-Host "Enter in the First Name" ... Do{ Write-Host $confirm = Read-Host "Is [$logonname] correct or would you ...
Read more >How To Prompt A User For Input In A PowerShell Script
A simple way to begin the journey to automation is to write scripts and prompt for user input. In this video, Jason will...
Read more >Active Directory Automated User Creation - YouTube
Create User Accounts with Powershell - Create your Active Directory Accounts quick and easily with this Powershell Script.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, there was a typo (now corrected) in my first account … I was typing too fast! 😃 It’s …
You can test all this with the command line
cli4
program. For example …You were correct in your read of https://api.cloudflare.com/#zone-list-zones and I was wrong with the param
account
. The documentation is correct and itsaccount.name
(oraccount.id
if you already know the 32 digit account number already.Hope that gets you back on track (and don’t forget that you can test quickly with
cli4
.FYI: If you use the https://dash.cloudflare.com/ site, you can change your account name so it’s a simpler string.
Your example above is beyond the Python library; however, any param passed that is not part of the API is ignored. The following shows that. This is valid:
This is ignored (and all my zones from all my accounts are shown):
Hence I think the issue is the exact spelling (and/or) character encoding of your account name (that’s why I recommend changing it via the dashboard (or even via the API). Oh … run this command:
Hope that helps.