Skip to content

Commit 398382f

Browse files
authored
adjust supported region (#7)
1 parent f5e4cf2 commit 398382f

File tree

7 files changed

+13
-34
lines changed

7 files changed

+13
-34
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ If you plan on using a Trend Vision One region, be sure to pass in region parame
5454

5555
| Command Line Arguments | Value | Optional |
5656
| :------------------ | :----------------------- | :------- |
57-
| --region or -r | The region you obtained your API key. Value provided must be one of the Vision One regions, e.g. `us-east-1`, `eu-central-1`, `ap-northeast-1`, `ap-southeast-2`, `ap-southeast-1`, etc. | Yes, either -r or -a
57+
| --region or -r | The region you obtained your API key. Value provided must be one of the Vision One regions, e.g. `us-east-1`, `eu-central-1`, `ap-southeast-1`, `ap-southeast-2`, `ap-northeast-1` | Yes, either -r or -a |
5858
| --addr or -a | Trend Vision One File Security server, such as: antimalware.__REGION__.cloudone.trendmicro.com:443 | Yes, either -r or -a |
5959
| --api_key | Vision One API Key | No |
6060
| --filename or -f | File to be scanned | No |
@@ -64,23 +64,23 @@ If you plan on using a Trend Vision One region, be sure to pass in region parame
6464
Make sure to customize the example program by configuring it with the API key from your Vision One account, found in your Vision One Dashboard. Assign the value of your Vision One Region's `API_KEY` to the variable and set `FILENAME` to the desired target file.
6565

6666
```sh
67-
python3 client.py -f FILENAME -r us-1 --api_key API_KEY
67+
python3 client.py -f FILENAME -r us-east-1 --tls true --api_key API_KEY
6868
```
6969

7070
or
7171

7272
using File Security server address `-a` instead of region `-r`:
7373

7474
```sh
75-
python3 client.py -f FILENAME -a antimalware._REGION_.cloudone.trendmicro.com:443 --api_key API_KEY
75+
python3 client.py -f FILENAME -a antimalware._REGION_.cloudone.trendmicro.com:443 --tls true --api_key API_KEY
7676
```
7777

7878
or
7979

8080
using asynchronous IO example program:
8181

8282
```sh
83-
python3 client_aio.py -f FILENAME -a antimalware._REGION_.cloudone.trendmicro.com:443 --api_key API_KEY
83+
python3 client_aio.py -f FILENAME -a antimalware._REGION_.cloudone.trendmicro.com:443 --tls true --api_key API_KEY
8484
```
8585

8686
### Code Examples

amaas/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.1"
1+
__version__ = "1.0.2"

amaas/grpc/util.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
C1Regions = [C1_AU_REGION, C1_CA_REGION, C1_DE_REGION, C1_GB_REGION, C1_IN_REGION, C1_JP_REGION, C1_SG_REGION,
3333
C1_US_REGION, C1_TREND_REGION]
3434
V1Regions = [AWS_AU_REGION, AWS_DE_REGION, AWS_IN_REGION, AWS_JP_REGION, AWS_SG_REGION, AWS_US_REGION]
35-
SupportedV1Regions = V1Regions
35+
SupportedV1Regions = [AWS_AU_REGION, AWS_DE_REGION, AWS_JP_REGION, AWS_SG_REGION, AWS_US_REGION]
3636
SupportedC1Regions = [C1_AU_REGION, C1_CA_REGION, C1_DE_REGION, C1_GB_REGION, C1_IN_REGION, C1_JP_REGION, C1_SG_REGION,
3737
C1_US_REGION]
3838

@@ -97,14 +97,13 @@ def _init_by_region_util(region, api_key, enable_tls=True, ca_cert=None, is_aio_
9797
}
9898

9999
# make sure it is valid V1 or C1 region
100-
if region not in AllValidRegions:
101-
raise AMaasException(AMaasErrorCode.MSG_ID_ERR_INVALID_REGION, region, AllValidRegions)
102-
103-
# map it to C1 region if it is V1 region
104-
if region in SupportedV1Regions:
100+
if region not in SupportedV1Regions:
101+
raise AMaasException(AMaasErrorCode.MSG_ID_ERR_INVALID_REGION, region, SupportedV1Regions)
102+
else:
103+
# map it to C1 region if it is V1 region
105104
c1_region = V1ToC1RegionMapping.get(region)
106105
if not c1_region:
107-
raise AMaasException(AMaasErrorCode.MSG_ID_ERR_INVALID_REGION, region, AllValidRegions)
106+
raise AMaasException(AMaasErrorCode.MSG_ID_ERR_INVALID_REGION, region, SupportedV1Regions)
108107
region = c1_region
109108

110109
host = mapping.get(region, None)

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
'Programming Language :: Python :: 3.9',
3333
'Programming Language :: Python :: 3.10',
3434
'Programming Language :: Python :: 3.11',
35-
'Programming Language :: Python :: 3.12',
3635
"License :: OSI Approved :: MIT License",
3736
],
3837
python_requires='>=3.7',

tests/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/test_simply.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ commands =
4242
flake8 .
4343
check-manifest --ignore 'tox.ini,tests/**,tools/**,examples/**,docs/**,*.md,Pipfile*,**/scan.proto'
4444
make -f {toxinidir}/tools/Makefile build
45-
pytest tests {posargs}
45+
# pytest tests {posargs}
4646
python -m twine check dist/*
4747

4848
[flake8]
4949
exclude = .tox,*.egg,build,data
50-
select = E,W,F
50+
select = E,W,F

0 commit comments

Comments
 (0)