Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arcgismanager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈高星
arcgismanager
Commits
71e83538
Commit
71e83538
authored
May 16, 2019
by
chengaoxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update : update
parent
83343971
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
readme.md
readme.md
+1
-0
src/portalmng.py
src/portalmng.py
+24
-11
No files found.
readme.md
View file @
71e83538
src/portalmng.py
View file @
71e83538
...
...
@@ -52,7 +52,8 @@ class arcgis(object):
return
True
def
create_site
(
self
):
##{"type":"fileStore","provider":"FileSystem","connectionString":"/arcgis/portal/usr/arcgisportal/content"}
##
defaultdir
=
"
%
s/portal/usr"
%
self
.
arcgishome
content_store_path
=
self
.
content
...
...
@@ -76,7 +77,6 @@ class arcgis(object):
}
uri
=
"https://
%
s:7443/arcgis/portaladmin/createNewSite"
%
self
.
hostname
print
(
uri
)
try
:
response
=
requests
.
post
(
uri
,
...
...
@@ -91,7 +91,11 @@ class arcgis(object):
print
(
"Some error happended when create the new site:
\n
%
s
\n
"
%
(
err
))
return
False
else
:
print
(
"Response :
%
s"
%
(
response
.
text
))
#Response : {"status":"success","recheckAfterSeconds":20}
resp
=
json
.
loads
(
response
.
text
)
if
resp
.
get
(
'status'
,
None
)
!=
'success'
:
print
(
"Warning: Fail to create a new site. Information :
%
s"
%
(
response
.
text
))
return
False
except
Exception
as
e
:
print
(
"Error when post the requrest with reason :
%
s"
%
e
)
timeout
=
True
...
...
@@ -107,6 +111,8 @@ if __name__ == "__main__":
# """
# )
parser
=
argparse
.
ArgumentParser
(
add_help
=
True
)
parser
.
add_argument
(
"opt"
,
type
=
str
,
choices
=
[
'createnewsite'
]
help
=
"optaions: createnewsite ..."
)
parser
.
add_argument
(
"-a"
,
"--arcgishome"
,
default
=
"/arcgis"
,
help
=
"The home path where arcgis portal installed, default is /arcgis"
)
parser
.
add_argument
(
"-n"
,
"--hostname"
,
default
=
"arcgisportal"
,
...
...
@@ -116,7 +122,7 @@ if __name__ == "__main__":
parser
.
add_argument
(
"-p"
,
"--password"
,
default
=
"Aa123456"
,
help
=
"the password to register amdin account, default is ABCD1234"
)
parser
.
add_argument
(
"-c"
,
"--content"
,
default
=
None
,
help
=
"the path to content store, defautl is $ARCGISHOME/portal/usr/arcgisportal"
)
help
=
"the path to content store, defautl is $ARCGISHOME/portal/usr/arcgisportal
/content
"
)
parser
.
add_argument
(
"-f"
,
"--fullname"
,
default
=
"PORTAL ADMIN"
,
help
=
"the full name for admin user,default as APAAS CUSTOMER"
)
parser
.
add_argument
(
"-e"
,
"--email"
,
default
=
"portaladmin@bd-apaas.com"
,
...
...
@@ -126,6 +132,11 @@ if __name__ == "__main__":
args
=
parser
.
parse_args
()
if
args
.
opt
!=
'createnewsite'
:
print
(
"unsupported options, aviable is : createnewsite "
)
print
(
args
.
print_help
())
sys
.
exit
(
2
)
if
args
.
content
is
None
:
args
.
content
=
"{}/portal/usr/arcgisportal"
.
format
(
args
.
arcgishome
)
if
args
.
javahome
is
None
:
...
...
@@ -145,7 +156,7 @@ if __name__ == "__main__":
user
=
args
.
user
,
passwd
=
args
.
password
,
hostname
=
args
.
hostname
,
content
=
args
.
content
,
content
=
(
args
.
content
)
.
rstrip
(
'/'
)
,
fullname
=
args
.
fullname
,
email
=
args
.
email
...
...
@@ -159,9 +170,11 @@ if __name__ == "__main__":
java_home
=
args
.
javahome
)
if
ag
.
create_site
():
print
(
"Success ..."
)
sys
.
exit
(
0
)
else
:
print
(
"Failed to Create a new site"
)
sys
.
exit
(
1
)
if
args
.
opt
==
"createnewsite"
:
print
(
"Create a new admin site"
)
if
ag
.
create_site
():
print
(
"Succeed creating a admin account, visit : https://
%
s:7443/arcgis/home"
%
(
args
.
hostname
))
sys
.
exit
(
0
)
else
:
print
(
"Failed to Create a new site"
)
sys
.
exit
(
1
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment