Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GP-493] - Apply renaming with AMS token instead of CMS #3

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# ARNIADB Manager Server System

ARNIADB Manager Server(CMS) is a part of ARNIADB Tools.
ARNIADB Manager Server(AMS) is a part of ARNIADB Tools.

CMS provides both HTTP or Socket interfaces for ARNIADB Manager
AMS provides both HTTP or Socket interfaces for ARNIADB Manager
to managing ARNIADB system, and also provides monitoring information about ARNIADB system.

## MAJOR REFERENCES

- ARNIADB Official Site: http://www.arniadb.org and http://www.arniadb.com

## DOWNLOADS and FILE REPOSITORIES
CMS is distributed within ARNIADB distribution which can be found here:
AMS is distributed within ARNIADB distribution which can be found here:

- http://www.arniadb.org/downloads
- http://ftp.arniadb.org

## HOW TO BUILD/INSTALL CMS
## HOW TO BUILD/INSTALL AMS

### build and install on Linux

Unzip the package of ARNIADB and you can find the source code of CMS here: arniadb-{version}/arniadbmanager/server.
Unzip the package of ARNIADB and you can find the source code of AMS here: arniadb-{version}/arniadbmanager/server.

1. Move to the directory where the source is stored.

Expand Down Expand Up @@ -57,7 +57,7 @@ Unzip the package of ARNIADB and you can find the source code of CMS here: arnia

### build and install on windows

If you want to build CMS on windows, VS2008 must be installed.
If you want to build AMS on windows, VS2008 must be installed.

1. Open a commander "cmd.exe" and Move to the directory where the source is stored.

Expand All @@ -78,7 +78,7 @@ If you want to build CMS on windows, VS2008 must be installed.

## PROGRAMMING APIs

- [CMS APIs](docs/api/README.md)
- [AMS APIs](docs/api/README.md)


## GETTING HELP
Expand All @@ -88,4 +88,4 @@ questions, or find bugs, or have some suggestions, we kindly ask you to
post your thoughts on our subreddit at https://www.reddit.com/r/ARNIADB/.

Sincerely,
Your CMS Development Team.
Your AMS Development Team.
22 changes: 11 additions & 11 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

## Overview

The ARNIADB Manager Server (CMS) HTTP Interface is an interface that exists between the ARNIADB manager server and the application client, through which a web-based application client can access the ARNIADB manager server. The ARNIADB manager server delivers the request received from an application client to the ARNIADB, and transfers the execution result to the client.
The ARNIADB Manager Server (AMS) HTTP Interface is an interface that exists between the ARNIADB manager server and the application client, through which a web-based application client can access the ARNIADB manager server. The ARNIADB manager server delivers the request received from an application client to the ARNIADB, and transfers the execution result to the client.

## System Architecture

CMS is a manager tools for ARNIADB including database configure, monitor, SQL query. As the component of the ARNIADB Database Management System, CMS provides a web-based tool that allows users to remotely manage the database and the Broker.
AMS is a manager tools for ARNIADB including database configure, monitor, SQL query. As the component of the ARNIADB Database Management System, AMS provides a web-based tool that allows users to remotely manage the database and the Broker.

![CMS Architecture](images/architecture.png?raw=true "CMS Architecture")
CMS Architecture
![AMS Architecture](images/architecture.png?raw=true "AMS Architecture")
AMS Architecture

## Writing HTTP Application Program

CMS http interface is REST-like interface, client can POST JSON-format request to url `http://cms_ip:cms_port/cm_api`, and receive the execution result.
AMS http interface is REST-like interface, client can POST JSON-format request to url `http://ams_ip:ams_port/am_api`, and receive the execution result.

The basic steps used for writing programs are as follows. First client must log in CMS with DBMT user name and password. If client login success, CMS will return a token which will be used in following request. The steps are implemented in example codes.
The basic steps used for writing programs are as follows. First client must log in AMS with DBMT user name and password. If client login success, AMS will return a token which will be used in following request. The steps are implemented in example codes.

Example in Python Request:

Expand All @@ -29,7 +29,7 @@ body = "{\"task\":\"login\",\

headers = {"Accept": "text/plain;charset=utf-8"}
conn = http.client.HTTPConnection("localhost", 8003)
conn.request("POST", "/cm_api", body, headers)
conn.request("POST", "/am_api", body, headers)
r = conn.getresponse()
print (r.read())
```
Expand Down Expand Up @@ -60,9 +60,9 @@ There are seven permissions. These permissions can indicate which authorities ar
| ADMIN | Indicate the authority of admin |
| ALL_AUTHORITY | This value is equal to "DBC | DBO | BRK | MON | JOB | VAR" |

## CMS Interfaces
## AMS Interfaces

CMs Interfaces are conposed by Json and is used for communication between CMS and Arniadb Manager.
AMS Interfaces are conposed by Json and is used for communication between AMS and Arniadb Manager.

### Broker

Expand Down Expand Up @@ -123,7 +123,7 @@ CMs Interfaces are conposed by Json and is used for communication between CMS an
| [updateuser](updateuser.md) | socket, http | DBO |
| [userverify](userverify.md) | socket, http | ALL_AUTHORITY |

### CM User
### AM User

| **Interface Name**| **Connection Type** | **Permission** | **Support Version** |
| --- | --- | --- | --- |
Expand Down Expand Up @@ -226,6 +226,6 @@ CMs Interfaces are conposed by Json and is used for communication between CMS an
| [getstandbyserverstat](getstandbyserverstat.md) | socket, http | ALL_AUTHORITY |
| [login](login.md) | socket, http | ALL_AUTHORITY |
| [logout](logout.md) | socket, http | ALL_AUTHORITY |
| [getcmsenv](getcmsenv.md) | socket, http | ALL_AUTHORITY |
| [getamsenv](getamsenv.md) | socket, http | ALL_AUTHORITY |
| [shard_start](shard_start.md) | socket, http | DBC, DBO, BRK |
| [shard_stop](shard_stop.md) | socket, http | DBC, DBO, BRK |
2 changes: 1 addition & 1 deletion docs/api/getallsysparam.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Get configuration files.
| --- | --- |
| task | task name |
| token | token string encrypted. |
| confname | arniadbconf, cmconf, haconf, databases |
| confname | arniadbconf, amconf, haconf, databases |

## Request Sample

Expand Down
4 changes: 2 additions & 2 deletions docs/api/getcmsenv.md → docs/api/getamsenv.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# getcmsenv
# getamsenv

Get databases' information in arniadb.

Expand All @@ -14,7 +14,7 @@ Get databases' information in arniadb.

```
{
"task":"getcmsenv",
"task":"getamsenv",
"token":"4504b930fc1be99bf5dfd31fc5799faaa3f117fb903f397de087cd3544165d857926f07dd201b6aa"
}
```
2 changes: 1 addition & 1 deletion docs/api/getdbmtuserinfo_new.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# getdbmtuserinfo_new

Get CM/CWM user information
Get AM/AWM user information

## Request Json Syntax

Expand Down
2 changes: 1 addition & 1 deletion docs/api/monitorprocess.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# monitorprocess

Monitor CMS process status.
Monitor AMS process status.

## Request Json Syntax

Expand Down
2 changes: 1 addition & 1 deletion docs/api/updatedbmtuser_new.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# updatedbmtuser_new

Update CM/CWM user information
Update AM/AWM user information

## Request Json Syntax

Expand Down
2 changes: 1 addition & 1 deletion server/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
#

AUTOMAKE_OPTIONS = foreign
SUBDIRS = cmserver external
SUBDIRS = amserver external

EXTRA_DIST = BUILD_NUMBER autogen.sh build_internal.bat build.bat build_server.bat build_external.sh test win src
60 changes: 30 additions & 30 deletions server/cmserver/Makefile.am → server/amserver/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,36 @@ INCLUDES = @SRC_INC@
DEFS += @SYS_DEFS@ @VERSION_DEFS@ @COMMON_DEFS@
LIBS += @SYS_LIBS@

bin_PROGRAMS = cm_admin arn_manager

cm_admin_SOURCES = \
$(DBMT_DIR)/cm_text_encryption.c \
$(DBMT_DIR)/cm_config.cpp \
$(DBMT_DIR)/cm_server_util.cpp \
$(DBMT_DIR)/cm_user.cpp \
$(DBMT_DIR)/cm_cmd.cpp \
$(DBMT_DIR)/cm_cmd_util.cpp \
$(DBMT_DIR)/cm_connect_info.cpp \
$(DBMT_DIR)/cm_cmd_task.cpp
cm_admin_CFLAGS = -D_FILE_OFFSET_BITS=64
cm_admin_LDFLAGS = @CMDEP_LIB@ -D_FILE_OFFSET_BITS=64
bin_PROGRAMS = am_admin arn_manager

am_admin_SOURCES = \
$(DBMT_DIR)/am_text_encryption.c \
$(DBMT_DIR)/am_config.cpp \
$(DBMT_DIR)/am_server_util.cpp \
$(DBMT_DIR)/am_user.cpp \
$(DBMT_DIR)/am_cmd.cpp \
$(DBMT_DIR)/am_cmd_util.cpp \
$(DBMT_DIR)/am_connect_info.cpp \
$(DBMT_DIR)/am_cmd_task.cpp
am_admin_CFLAGS = -D_FILE_OFFSET_BITS=64
am_admin_LDFLAGS = @CMDEP_LIB@ -D_FILE_OFFSET_BITS=64

arn_manager_SOURCES = \
$(DBMT_DIR)/cm_server_util.cpp \
$(DBMT_DIR)/cm_autojob.cpp \
$(DBMT_DIR)/cm_text_encryption.c \
$(DBMT_DIR)/cm_config.cpp \
$(DBMT_DIR)/cm_job_task.cpp \
$(DBMT_DIR)/cm_cmd_exec.cpp \
$(DBMT_DIR)/cm_connect_info.cpp \
$(DBMT_DIR)/cm_auto_task.cpp \
$(DBMT_DIR)/cm_httpd.cpp \
$(DBMT_DIR)/cm_mon_stat.cpp \
$(DBMT_DIR)/cm_user.cpp \
$(DBMT_DIR)/cm_http_server.cpp \
$(DBMT_DIR)/cm_server_extend_interface.cpp \
$(DBMT_DIR)/cm_server_interface.cpp \
$(DBMT_DIR)/cm_cci_interface.cpp \
$(DBMT_DIR)/cm_server_autoupdate.cpp
$(DBMT_DIR)/am_server_util.cpp \
$(DBMT_DIR)/am_autojob.cpp \
$(DBMT_DIR)/am_text_encryption.c \
$(DBMT_DIR)/am_config.cpp \
$(DBMT_DIR)/am_job_task.cpp \
$(DBMT_DIR)/am_cmd_exec.cpp \
$(DBMT_DIR)/am_connect_info.cpp \
$(DBMT_DIR)/am_auto_task.cpp \
$(DBMT_DIR)/am_httpd.cpp \
$(DBMT_DIR)/am_mon_stat.cpp \
$(DBMT_DIR)/am_user.cpp \
$(DBMT_DIR)/am_http_server.cpp \
$(DBMT_DIR)/am_server_extend_interface.cpp \
$(DBMT_DIR)/am_server_interface.cpp \
$(DBMT_DIR)/am_cci_interface.cpp \
$(DBMT_DIR)/am_server_autoupdate.cpp
arn_manager_CPPFLAGS = $(AM_CFLAGS) -DFSERVER_SLAVE -DJSON_SUPPORT -DEVENT__HAVE_OPENSSL -D_FILE_OFFSET_BITS=64 @EXTERNAL_INC@
arn_manager_LDFLAGS = -larniadbcs @CMSTAT_LIB@ @CMDEP_LIB@ @EXTERNAL_LIB@ -lrt -lcascci
arn_manager_LDFLAGS = -larniadbcs @AMSTAT_LIB@ @CMDEP_LIB@ @EXTERNAL_LIB@ -lrt -lcascci
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

confdir = ${prefix}/conf
dist_conf_DATA = autohistory.conf cmdb.pass autoaddvoldb.conf diagactivitytemplate.conf autobackupdb.conf cm.conf diagstatustemplate.conf autoexecquery.conf cm.pass \
cm_ssl_cert.crt cm_ssl_cert.key
am_ssl_cert.crt am_ssl_cert.key

8 changes: 4 additions & 4 deletions server/cmserver/conf/cm.conf → server/amserver/conf/am.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
#
# Port number designation
# A port for the connection between ARNIADB Manager server and Client.
# ARNIADB Manager server uses the value cm_port.
# ARNIADB Manager server uses the value am_port.
# The default value is 8001.
#
cm_port=8001
am_port=8001

#
# CMS Process Monitoring interval setting
# AMS Process Monitoring interval setting
#
cm_process_monitor_interval=5
am_process_monitor_interval=5

#
# Allowing Multiple connection with one ARNIADB Manager user.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions server/build_server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ REM prepare vc environment

call "%VS90COMNTOOLS%vsvars32.bat"

echo Start build cm_server ...
echo Start build am_server ...
cd win

set arniadb_libdir=%arniadb_libdir%
set arniadb_includedir=%arniadb_includedir%

cmd /c devenv cmserver.sln /project install /rebuild "%mode%|%platform%"
cmd /c devenv amserver.sln /project install /rebuild "%mode%|%platform%"
set exitcode=%errorlevel%
cd ..
if not "%exitcode%" == "0" exit /b %exitcode%

cd win/install
cd CMServer_%mode%_%platform%
cd AMServer_%mode%_%platform%

robocopy . %prefix%\ /e
if errorlevel 1 (
Expand Down
14 changes: 7 additions & 7 deletions server/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AC_INIT([ARNIADB 2008], RELEASE, , arniadb)

AC_PREFIX_DEFAULT("${ARNIADB}")

AC_CONFIG_SRCDIR([src/cm_autojob.cpp])
AC_CONFIG_SRCDIR([src/am_autojob.cpp])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADERS([config.h])

Expand Down Expand Up @@ -52,7 +52,7 @@ export SYSTEM_TYPE MACHINE_TYPE
case $SYSTEM_TYPE in
*linux*) SYS_DEFS="-DGCC -DLINUX -D_GNU_SOURCE -DI386"
SYS_LIBS=""
CMSTAT_LIB=""
AMSTAT_LIB=""
if test "$bit_model" = "yes"
then
BIT_MODEL="-m64"
Expand All @@ -65,7 +65,7 @@ case $SYSTEM_TYPE in
*aix*)
SYS_DEFS="-DGCC -DAIX -D_GNU_SOURCE -DPPC -fsigned-char -D_THREAD_SAFE"
SYS_LIBS="-Wl,-bmaxdata:0x800000000 -Wl,-bnoipath"
CMSTAT_LIB="-lperfstat"
AMSTAT_LIB="-lperfstat"
CC="$CC -pthread"
CXX="$CXX -pthread"
if test "$enable_64bit" = "yes"
Expand Down Expand Up @@ -248,7 +248,7 @@ else
fi
ARNCS_LIB="-larniadbcs"
CMDEP_LIB="-L$ARNIADB_LIBDIR -lcmdep $ARNCS_LIB"
CMSTAT_LIB="-L$ARNIADB_LIBDIR -lcmstat $CMSTAT_LIB"
AMSTAT_LIB="-L$ARNIADB_LIBDIR -lamstat $AMSTAT_LIB"
SRC_INC="-I$ARNIADB_INCLUDEDIR"
fi

Expand Down Expand Up @@ -303,7 +303,7 @@ AC_SUBST([SYS_LIBS])
AC_SUBST([COMMON_DEFS])
AC_SUBST([VERSION_DEFS])
AC_SUBST([SRC_INC])
AC_SUBST([CMSTAT_LIB])
AC_SUBST([AMSTAT_LIB])
AC_SUBST([CMDEP_LIB])
AC_SUBST([EXTERNAL_LIB])
AC_SUBST([EXTERNAL_INC])
Expand All @@ -323,6 +323,6 @@ AH_BOTTOM([

AC_CONFIG_FILES([Makefile
external/Makefile
cmserver/Makefile
cmserver/conf/Makefile])
amserver/Makefile
amserver/conf/Makefile])
AC_OUTPUT
2 changes: 1 addition & 1 deletion server/hudsonbuild.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ case x$1 in
xtest)
cp $ARNIADB/conf/arniadb.conf $CRT_PATH/test/task_test_config/orign/
#cp $CRT_PATH/test/task_test_config/ha_conf/arniadb.conf $ARNIADB/conf/
cp -f $CRT_PATH/test/task_test_config/cm_conf/*.conf $ARNIADB/conf/
cp -f $CRT_PATH/test/task_test_config/am_conf/*.conf $ARNIADB/conf/

arniadb service restart
arniadb server start demodb
Expand Down
16 changes: 8 additions & 8 deletions server/src/cm_auto_task.cpp → server/src/am_auto_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@


/*
* cm_auto_task.cpp -
* am_auto_task.cpp -
*/

#include <stdio.h>
#include <string.h>

#include "cm_auto_task.h"
#include "cm_porting.h"
#include "cm_dep.h"
#include "cm_server_util.h"
#include "cm_config.h"
#include "cm_user.h"
#include "cm_text_encryption.h"
#include "am_auto_task.h"
#include "am_porting.h"
#include "am_dep.h"
#include "am_server_util.h"
#include "am_config.h"
#include "am_user.h"
#include "am_text_encryption.h"
#include "string.h"
#include "stdlib.h"

Expand Down
Loading