cacholong-cloud-cli 0.3.3__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/PKG-INFO +71 -14
  2. cacholong_cloud_cli-0.3.4/README.md +149 -0
  3. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/pyproject.toml +2 -1
  4. cacholong_cloud_cli-0.3.3/README.md +0 -94
  5. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/AsyncTyper.py +0 -0
  6. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/__init__.py +0 -0
  7. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/cli.py +0 -0
  8. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/commands/accounts.py +0 -0
  9. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/commands/addresses.py +0 -0
  10. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/commands/companies.py +0 -0
  11. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/commands/dns_records.py +0 -0
  12. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/commands/dns_templates.py +0 -0
  13. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/commands/dns_zones.py +0 -0
  14. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/commands/products.py +0 -0
  15. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/commands/purchases.py +0 -0
  16. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/common.py +0 -0
  17. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_cli/connection.py +0 -0
  18. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/__init__.py +0 -0
  19. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/account.py +0 -0
  20. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/address.py +0 -0
  21. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/api_schema.py +0 -0
  22. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/common.py +0 -0
  23. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/company.py +0 -0
  24. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/connection.py +0 -0
  25. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/dns_record.py +0 -0
  26. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/dns_template.py +0 -0
  27. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/dns_zone.py +0 -0
  28. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/exception.py +0 -0
  29. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/product.py +0 -0
  30. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/cacholong_sdk/purchase.py +0 -0
  31. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/__init__.py +0 -0
  32. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/common.py +0 -0
  33. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/document.py +0 -0
  34. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/exceptions.py +0 -0
  35. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/filter.py +0 -0
  36. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/objects.py +0 -0
  37. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/relationships.py +0 -0
  38. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/resourceobject.py +0 -0
  39. {cacholong_cloud_cli-0.3.3 → cacholong_cloud_cli-0.3.4}/jsonapi-client/src/jsonapi_client/session.py +0 -0
@@ -1,10 +1,12 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cacholong-cloud-cli
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Cacholong CLI, manage cloud environments at Cacholong!
5
+ License: MIT
5
6
  Author: Matthijs Möhlmann
6
7
  Author-email: matthijs@cacholong.nl
7
8
  Requires-Python: >=3.11,<4.0
9
+ Classifier: License :: OSI Approved :: MIT License
8
10
  Classifier: Programming Language :: Python :: 3
9
11
  Classifier: Programming Language :: Python :: 3.11
10
12
  Classifier: Programming Language :: Python :: 3.12
@@ -28,6 +30,14 @@ The API client library for managing various resources.
28
30
 
29
31
  ## Getting started
30
32
 
33
+ To install this package you need to take a few steps before this works correctly
34
+ 1. Create an virtual environment: python3 -m venv <directory>
35
+ 2. Activate the environment: <directory>/bin/activate
36
+ 3. Now install the package: pip install cacholong-cloud-cli
37
+ 4. Or upgrade the package: pip install cacholong-cloud-cli --upgrade
38
+
39
+ Now you can use the command `ccloud` on the system. Please note, make sure to activate the virtual environment before running the command `ccloud`.
40
+
31
41
  You will need an API-token. This token can be created using our panel at https://cp.cacholong.eu/#/user/settings/api. You can create an api token within your profile under API.
32
42
 
33
43
  When running the command `ccloud` for the first time it will ask you for an API-token.
@@ -87,7 +97,7 @@ from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
87
97
 
88
98
  async def main():
89
99
  async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
90
- searchfilter = Filter(domain=sys.argv[1])
100
+ searchfilter = Filter(account="UUID_OF_ACCOUNT")
91
101
  DnsZoneCtrl = DnsZone(api)
92
102
  async for zone in DnsZoneCtrl.fetch_all(searchfilter):
93
103
  print(zone["domain"])
@@ -96,22 +106,69 @@ async def main():
96
106
  asyncio.run(main())
97
107
  ```
98
108
 
99
- ## Suggestions for a good README
100
- Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
109
+ ### Create a DNS-record
110
+ ```python
111
+ import asyncio
101
112
 
102
- ## Support
103
- Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
113
+ from cacholong_sdk.connection import connection
114
+ from cacholong_sdk import ResourceTuple, Inclusion, Filter
115
+ from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
116
+
117
+ async def main():
118
+ async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
119
+ DnsRecordCtrl = DnsRecord(api)
120
+
121
+ dns_record = DNSRecordCtrl.create()
122
+ dns_record["dns-zone"] = ResourceTuple("UUID_DNS_ZONE", "dns-zones")
123
+ dns_record["name"] = "localhost.example.nl"
124
+ dns_record["dns_record_type"] = "A"
125
+ dns_record["content"] = "127.0.0.1"
126
+ dns_record["ttl"] = 300
127
+ await DNSRecordCtrl.store(dns_record)
128
+
129
+ # Execute main function
130
+ asyncio.run(main())
131
+ ```
132
+
133
+ ### Update a DNS-record
134
+ ```python
135
+ import asyncio
136
+
137
+ from cacholong_sdk.connection import connection
138
+ from cacholong_sdk import ResourceTuple, Inclusion, Filter
139
+ from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
140
+
141
+ async def main():
142
+ async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
143
+ DnsRecordCtrl = DnsRecord(api)
144
+
145
+ dns_record = await DnsRecordCtrl.fetch("UUID_OF_DNS_RECORD")
146
+ dns_record["content"] = "127.0.0.1"
147
+
148
+ # Be careful: the above change will be applied automatically
149
+
150
+ # Execute main function
151
+ asyncio.run(main())
152
+ ```
153
+
154
+ ### Delete a DNS-record
155
+ ```python
156
+ import asyncio
104
157
 
105
- ## Roadmap
106
- If you have ideas for releases in the future, it is a good idea to list them in the README.
158
+ from cacholong_sdk.connection import connection
159
+ from cacholong_sdk import ResourceTuple, Inclusion, Filter
160
+ from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
107
161
 
108
- ## Contributing
109
- State if you are open to contributions and what your requirements are for accepting them.
162
+ async def main():
163
+ async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
164
+ DnsRecordCtrl = DnsRecord(api)
110
165
 
111
- For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
166
+ await DnsRecordCtrl.destroy("UUID_OF_DNS_RECORD")
112
167
 
113
- You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
168
+ # Execute main function
169
+ asyncio.run(main())
170
+ ```
114
171
 
115
- ## License
116
- For open source projects, say how it is licensed.
172
+ ## Support
173
+ Questions, feedback, or suggestions? Send us an email at [ccloud-support@cacholong.nl].
117
174
 
@@ -0,0 +1,149 @@
1
+ # CLI frontend
2
+
3
+ The API client library for managing various resources.
4
+
5
+ [Client Library Documentation](https://docs.cacholong.eu/api/)
6
+
7
+ ## Getting started
8
+
9
+ To install this package you need to take a few steps before this works correctly
10
+ 1. Create an virtual environment: python3 -m venv <directory>
11
+ 2. Activate the environment: <directory>/bin/activate
12
+ 3. Now install the package: pip install cacholong-cloud-cli
13
+ 4. Or upgrade the package: pip install cacholong-cloud-cli --upgrade
14
+
15
+ Now you can use the command `ccloud` on the system. Please note, make sure to activate the virtual environment before running the command `ccloud`.
16
+
17
+ You will need an API-token. This token can be created using our panel at https://cp.cacholong.eu/#/user/settings/api. You can create an api token within your profile under API.
18
+
19
+ When running the command `ccloud` for the first time it will ask you for an API-token.
20
+
21
+ After that you will be able to run the following command:
22
+ ```bash
23
+ ccloud accounts list
24
+ ```
25
+
26
+ This will give you an overview of accounts where you have access to.
27
+
28
+ ## Usage
29
+
30
+ Overview of the possibilities:
31
+ ```bash
32
+ ccloud --help
33
+ ```
34
+
35
+ To fetch an overview of the dns-zones for an account:
36
+ ```bash
37
+ ccloud dns-zones list --account <account uuid>
38
+ ```
39
+
40
+ Creating a DNS-record:
41
+ ```bash
42
+ ccloud dns-records create --dns-zone <dns-zone uuid> \
43
+ --name localhost.example.com \
44
+ --dns-record-type A \
45
+ --content 127.0.0.1 \
46
+ --ttl 300
47
+ ```
48
+
49
+ Updating a DNS-record:
50
+ ```bash
51
+ ccloud dns-records update <dns-record uuid> \
52
+ --content 127.0.0.1
53
+ ```
54
+
55
+ Deleting a DNS-record:
56
+ ```bash
57
+ ccloud dns-records delete <dns-record uuid>
58
+ ```
59
+
60
+ Every command includes an option --help which will give an overview of the possibilities.
61
+
62
+ ## Advanced usage
63
+
64
+ Its also possible to create your own command line utility to handle various parts. Here are the same examples as above but now using python.
65
+
66
+ ### Fetching DNS-zones
67
+ ```python
68
+ import asyncio
69
+
70
+ from cacholong_sdk.connection import connection
71
+ from cacholong_sdk import ResourceTuple, Inclusion, Filter
72
+ from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
73
+
74
+ async def main():
75
+ async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
76
+ searchfilter = Filter(account="UUID_OF_ACCOUNT")
77
+ DnsZoneCtrl = DnsZone(api)
78
+ async for zone in DnsZoneCtrl.fetch_all(searchfilter):
79
+ print(zone["domain"])
80
+
81
+ # Execute main function
82
+ asyncio.run(main())
83
+ ```
84
+
85
+ ### Create a DNS-record
86
+ ```python
87
+ import asyncio
88
+
89
+ from cacholong_sdk.connection import connection
90
+ from cacholong_sdk import ResourceTuple, Inclusion, Filter
91
+ from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
92
+
93
+ async def main():
94
+ async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
95
+ DnsRecordCtrl = DnsRecord(api)
96
+
97
+ dns_record = DNSRecordCtrl.create()
98
+ dns_record["dns-zone"] = ResourceTuple("UUID_DNS_ZONE", "dns-zones")
99
+ dns_record["name"] = "localhost.example.nl"
100
+ dns_record["dns_record_type"] = "A"
101
+ dns_record["content"] = "127.0.0.1"
102
+ dns_record["ttl"] = 300
103
+ await DNSRecordCtrl.store(dns_record)
104
+
105
+ # Execute main function
106
+ asyncio.run(main())
107
+ ```
108
+
109
+ ### Update a DNS-record
110
+ ```python
111
+ import asyncio
112
+
113
+ from cacholong_sdk.connection import connection
114
+ from cacholong_sdk import ResourceTuple, Inclusion, Filter
115
+ from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
116
+
117
+ async def main():
118
+ async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
119
+ DnsRecordCtrl = DnsRecord(api)
120
+
121
+ dns_record = await DnsRecordCtrl.fetch("UUID_OF_DNS_RECORD")
122
+ dns_record["content"] = "127.0.0.1"
123
+
124
+ # Be careful: the above change will be applied automatically
125
+
126
+ # Execute main function
127
+ asyncio.run(main())
128
+ ```
129
+
130
+ ### Delete a DNS-record
131
+ ```python
132
+ import asyncio
133
+
134
+ from cacholong_sdk.connection import connection
135
+ from cacholong_sdk import ResourceTuple, Inclusion, Filter
136
+ from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
137
+
138
+ async def main():
139
+ async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
140
+ DnsRecordCtrl = DnsRecord(api)
141
+
142
+ await DnsRecordCtrl.destroy("UUID_OF_DNS_RECORD")
143
+
144
+ # Execute main function
145
+ asyncio.run(main())
146
+ ```
147
+
148
+ ## Support
149
+ Questions, feedback, or suggestions? Send us an email at [ccloud-support@cacholong.nl].
@@ -1,9 +1,10 @@
1
1
  [tool.poetry]
2
2
  name = "cacholong-cloud-cli"
3
- version = "0.3.3"
3
+ version = "0.3.4"
4
4
  description = "Cacholong CLI, manage cloud environments at Cacholong!"
5
5
  authors = ["Matthijs Möhlmann <matthijs@cacholong.nl>"]
6
6
  readme = "README.md"
7
+ license = "MIT"
7
8
  packages = [
8
9
  { include = "cacholong_cli" },
9
10
  { include = "cacholong_sdk" },
@@ -1,94 +0,0 @@
1
- # CLI frontend
2
-
3
- The API client library for managing various resources.
4
-
5
- [Client Library Documentation](https://docs.cacholong.eu/api/)
6
-
7
- ## Getting started
8
-
9
- You will need an API-token. This token can be created using our panel at https://cp.cacholong.eu/#/user/settings/api. You can create an api token within your profile under API.
10
-
11
- When running the command `ccloud` for the first time it will ask you for an API-token.
12
-
13
- After that you will be able to run the following command:
14
- ```bash
15
- ccloud accounts list
16
- ```
17
-
18
- This will give you an overview of accounts where you have access to.
19
-
20
- ## Usage
21
-
22
- Overview of the possibilities:
23
- ```bash
24
- ccloud --help
25
- ```
26
-
27
- To fetch an overview of the dns-zones for an account:
28
- ```bash
29
- ccloud dns-zones list --account <account uuid>
30
- ```
31
-
32
- Creating a DNS-record:
33
- ```bash
34
- ccloud dns-records create --dns-zone <dns-zone uuid> \
35
- --name localhost.example.com \
36
- --dns-record-type A \
37
- --content 127.0.0.1 \
38
- --ttl 300
39
- ```
40
-
41
- Updating a DNS-record:
42
- ```bash
43
- ccloud dns-records update <dns-record uuid> \
44
- --content 127.0.0.1
45
- ```
46
-
47
- Deleting a DNS-record:
48
- ```bash
49
- ccloud dns-records delete <dns-record uuid>
50
- ```
51
-
52
- Every command includes an option --help which will give an overview of the possibilities.
53
-
54
- ## Advanced usage
55
-
56
- Its also possible to create your own command line utility to handle various parts. Here are the same examples as above but now using python.
57
-
58
- ### Fetching DNS-zones
59
- ```python
60
- import asyncio
61
-
62
- from cacholong_sdk.connection import connection
63
- from cacholong_sdk import ResourceTuple, Inclusion, Filter
64
- from cacholong_sdk import DnsZone, DnsZoneModel, DnsRecord, DnsRecordModel
65
-
66
- async def main():
67
- async with connection('https://api.cacholong.eu/api/v1/', 'YOUR-API-TOKEN') as api:
68
- searchfilter = Filter(domain=sys.argv[1])
69
- DnsZoneCtrl = DnsZone(api)
70
- async for zone in DnsZoneCtrl.fetch_all(searchfilter):
71
- print(zone["domain"])
72
-
73
- # Execute main function
74
- asyncio.run(main())
75
- ```
76
-
77
- ## Suggestions for a good README
78
- Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
79
-
80
- ## Support
81
- Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
82
-
83
- ## Roadmap
84
- If you have ideas for releases in the future, it is a good idea to list them in the README.
85
-
86
- ## Contributing
87
- State if you are open to contributions and what your requirements are for accepting them.
88
-
89
- For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
90
-
91
- You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
92
-
93
- ## License
94
- For open source projects, say how it is licensed.