Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zimbra-admin-api-js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
zimbra-admin-api-js
Commits
ade8ff54
Commit
ade8ff54
authored
May 05, 2017
by
Patricio Bruna
Committed by
GitHub
May 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17 from ZBoxApp/fix-handleError
Fix handle error
parents
9bf0577b
f1877ae0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
33 deletions
+35
-33
package.json
package.json
+1
-1
index.js
src/index.js
+2
-2
test.js
test/test.js
+26
-29
ipaddress.pyc
vagrant/provision/filter_plugins/ipaddress.pyc
+0
-0
playbook.yml
vagrant/provision/playbook.yml
+4
-0
main.yml
vagrant/provision/roles/bertvv.bind/tasks/main.yml
+1
-1
zimbra_configuration.conf.j2
...s/pbruna.zimbradev/templates/zimbra_configuration.conf.j2
+1
-0
No files found.
package.json
View file @
ade8ff54
{
"name"
:
"zimbra-admin-api-js"
,
"version"
:
"0.3.1
4
"
,
"version"
:
"0.3.1
5
"
,
"main"
:
"src/index.js"
,
"engines"
:
{
"node"
:
">=6.2"
...
...
src/index.js
View file @
ade8ff54
...
...
@@ -149,9 +149,9 @@ class ZimbraAdminApi {
}
else
{
const
that
=
this
;
let
getCallback
=
function
(
err
,
response
){
if
(
err
)
return
th
is
.
handleError
(
err
);
if
(
err
)
return
th
at
.
handleError
(
err
);
if
(
request_data
.
batch
)
return
that
.
makeBatchRequest
(
request_data
.
requests
,
request_data
.
callback
);
that
.
makeRequest
(
request_data
)
;
that
.
makeRequest
(
request_data
)
};
this
.
login
(
getCallback
);
}
...
...
test/test.js
View file @
ade8ff54
...
...
@@ -18,7 +18,8 @@ var zimbraAdminPassword = process.env.ZIMBRA_PASSWORD || '12345678';
var
auth_data
=
{
'url'
:
zimbraURL
,
'user'
:
zimbraAdminUser
,
'password'
:
zimbraAdminPassword
'password'
:
zimbraAdminPassword
,
'isAdmin'
:
true
};
describe
(
'Basic tests'
,
function
()
{
...
...
@@ -376,7 +377,6 @@ var zimbraAdminPassword = process.env.ZIMBRA_PASSWORD || '12345678';
let
api
=
new
ZimbraAdminApi
(
auth_data
);
api
.
getAccountMembership
(
account
,
function
(
err
,
data
){
if
(
err
)
return
console
.
log
(
err
);
console
.
log
(
data
);
expect
(
data
.
length
).
to
.
be
.
equal
(
0
);
done
();
});
...
...
@@ -829,71 +829,70 @@ var zimbraAdminPassword = process.env.ZIMBRA_PASSWORD || '12345678';
});
describe
(
'COS tests'
,
function
()
{
this
.
timeout
(
5000
);
let
cos_name
=
Date
.
now
().
toString
();
let
cos_id
;
it
(
'Should create a COS'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
let
cos_name
=
Date
.
now
();
let
attrs
=
{
'zimbraFeatureContactsEnabled'
:
'FALSE'
};
api
.
createCos
(
cos_name
,
attrs
,
function
(
err
,
cos
){
if
(
err
)
return
console
.
error
(
err
);
expect
(
err
).
to
.
be
.
null
;
cos_id
=
cos
.
id
;
done
();
});
})
it
(
'Should delete COS "unknow" '
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
api
.
getCos
(
"unknow"
,
function
(
err
,
cos
){
if
(
err
)
return
console
.
error
(
err
);
let
cosId
=
cos
.
id
;
console
.
log
(
cosId
);
api
.
deleteCos
(
cosId
,
function
(
err
,
res
){
if
(
err
)
return
console
.
error
(
err
);
console
.
log
(
res
);
expect
(
err
).
to
.
be
.
null
;
done
();
})
});
})
it
(
'Should modify a Cos "basic"'
,
function
(
done
){
it
(
'Should modify a Cos'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
let
attrs
=
{
'zimbraDumpsterEnabled'
:
'TRUE'
};
api
.
getCos
(
"basic"
,
function
(
err
,
cos
){
api
.
getCos
(
cos_name
,
function
(
err
,
cos
){
if
(
err
)
return
console
.
error
(
err
);
api
.
modifyCos
(
cos
.
id
,
attrs
,
function
(
err
,
res
){
if
(
err
)
return
console
.
error
(
err
);
console
.
log
(
res
);
expect
(
err
).
to
.
be
.
null
;
done
();
});
});
});
it
(
'Should rename Cos "Basic"
'
,
function
(
done
){
it
.
skip
(
'Should rename Cos
'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
let
newName
=
"basicv2"
api
.
getCos
(
"basic"
,
function
(
err
,
cos
){
let
newName
=
Date
.
now
().
toString
();
api
.
getCos
(
cos_name
,
function
(
err
,
cos
){
if
(
err
)
return
console
.
error
(
err
);
api
.
renameCos
(
cos
.
id
,
newName
,
function
(
err
,
res
){
if
(
err
)
return
console
.
log
(
err
);
console
.
log
(
res
);
expect
(
err
).
to
.
be
.
null
;
done
();
});
});
});
it
.
only
(
'Should create a copy of Cos Professional
'
,
function
(
done
){
it
.
skip
(
'Should create a copy of Cos
'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
let
newCos
=
Date
.
now
();
api
.
copyCos
(
"professional"
,
newCos
,
function
(
err
,
res
){
api
.
copyCos
(
cos_name
,
newCos
,
function
(
err
,
res
){
if
(
err
)
return
console
.
error
(
err
);
expect
(
err
).
to
.
be
.
null
;
done
();
})
});
it
(
'Should delete COS'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
api
.
getCos
(
cos_name
,
function
(
err
,
cos
){
if
(
err
)
return
console
.
error
(
err
);
let
cosId
=
cos
.
id
;
console
.
log
(
cosId
);
api
.
deleteCos
(
cosId
,
function
(
err
,
res
){
if
(
err
)
return
console
.
error
(
err
);
expect
(
err
).
to
.
be
.
null
;
done
();
})
});
})
});
describe
(
'DistributionList tests'
,
function
()
{
...
...
@@ -953,7 +952,6 @@ var zimbraAdminPassword = process.env.ZIMBRA_PASSWORD || '12345678';
let
dl
=
data
;
api
.
addDistributionListAlias
(
dl
.
id
,
alias
,
function
(
err
,
data
){
if
(
err
)
return
console
.
error
(
err
);
console
.
log
(
data
);
expect
(
err
).
to
.
be
.
null
;
done
();
});
...
...
@@ -969,7 +967,6 @@ var zimbraAdminPassword = process.env.ZIMBRA_PASSWORD || '12345678';
if
(
err
)
return
console
.
error
(
err
);
api
.
removeDistributionListAlias
(
dl
.
id
,
alias
,
function
(
err
,
data
){
if
(
err
)
return
console
.
error
(
err
);
console
.
log
(
data
);
expect
(
err
).
to
.
be
.
null
;
done
();
});
...
...
vagrant/provision/filter_plugins/ipaddress.pyc
View file @
ade8ff54
No preview for this file type
vagrant/provision/playbook.yml
View file @
ade8ff54
...
...
@@ -19,6 +19,10 @@
-
name
:
'
zimbra'
ip
:
'
192.168.50.10'
tasks
:
-
name
:
up network card
command
:
/usr/sbin/ifconfig eth1 up
roles
:
-
role
:
common
-
role
:
bertvv.bind
...
...
vagrant/provision/roles/bertvv.bind/tasks/main.yml
View file @
ade8ff54
...
...
@@ -5,7 +5,7 @@
yum
:
pkg
:
"
{{
item
}}"
state
:
installed
with_items
:
bind_packages
with_items
:
"
{{bind_packages}}"
tags
:
bind
-
name
:
Create serial
...
...
vagrant/provision/roles/pbruna.zimbradev/templates/zimbra_configuration.conf.j2
View file @
ade8ff54
...
...
@@ -16,3 +16,4 @@ EXPANDMENU="no"
HOSTNAME="{{ ansible_nodename }}"
DOTRAINSA="yes"
ENABLEGALSYNCACCOUNTS=""
INSTALL_PACKAGES="zimbra-core zimbra-ldap zimbra-logger zimbra-mta zimbra-snmp zimbra-store zimbra-apache zimbra-spell zimbra-convertd"
\ No newline at end of file
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