Wednesday, June 14, 2017

About curl commands

Curl —
It is Http service interface 
we can automate the process
we have to use the command line tool
CURL is an open source command line tool for performing  URL manipulations.It is designed for transferring data using various protocols like FTP,FTPS,Gopher,HTTP,HTTPS,IMAPS,POP3,RTMP,SCP,SFTP and many more.cURL was released in 1997.The name cURL stands for “see URL”

for example:
when you setup the instance you need to upload 50-60 packages, so at this scenario we require automation.
how about having one batch file as a command, when we say batch file it means the list of commands:
curl commands to upload the package,so for 60 packages we will have 60 commands so it is easy for us.
so by double clicking the batch file you will get all packages to get uploaded.
So by this way we can automate all the process.
for admin scripts place an important role.

——>we have to download the cURL  and we will get the binary file.
CRX package manager will not be fast,as we production instance  is very slow, we have to use the cURL commands.
During adobe will have around 80 hot fixes per day that has to be updated in the production.

question:on the screen of package manager  we can see in that, if we want to see in AEM,how we can??

we need to connect with curl command the AEM 
to get help screen:
we need to replace the local host with the company name DNS and we can replace the directory structure of that also.

-u username:password

by using above cURL command, we can able to know how we can use the package using cURL command.

How we can add the argument to the url??
by adding the query parameter  that is the url we are writing

How to get list of packages in the AEM??
there are saying add argument cmd = ls  (print a list of all packages).

To list packages that are currently available 
curl -u admin:admin http://localhost:4502/crx/packmgr/service.jsp?cmd=ls
here is the command we explained.

How to upload a Zip ??
curl -u admin:admin  -F file=@dummy_content.zip http://localhost:4503/crx/packmgr/service.jsp 

what is the advantage of using cURL command in the command line??
1)Multipackages can  be uploaded at a time in to a single instance.
2)Second most advantages when we are using the instances:
for instance, we have QA,UAT AND PRODUCTION environments .
for suppose we have adobe hot fixes :i need to install 4 packages ,these  packages must be installed on all the environments.on both author and publish of all the environments.
if we do manually we need to do 24 times.here we are using a cURL command
curl -u admin:admin  -F name=dummy_content http://localhost:4503/crx/packmgr/service.jsp?cmd=inst

cURL is the http service based interface, we need to know the different http status codes.

To remove the package:
curl -u admin:admin  -F name=dummy_content http://localhost:4503/crx/packmgr/service.jsp?cmd=rm 

————————————————————————————————————————————————
In some companies we have weekly deployment/biweekly deployment
In large scale companies we have to install 30 package and remove 20 packages we can use following curl command and write in a one batch file.
this is where automation come into the picture
——————————————————————————————————————————————————
we have to manage the user management also??
There are two kinds of usersmanagement:
Internal user (which are created in AEM).
External login module (e.g. like LDAP).
Suppose you have very big team with authoring 50 users, for the first time i built production instances and i want to add these users to the production instances.
How to add a user??
go to useradmin console  localhost:4502/useradmin
Create user and give all the details of the user, but the problem if you want to add the 100 users using user admin is difficult.
User management operations:
How to automate the users to the production instances??
curl -u admin:admin -Fcreateuser= -FauthorizableId=kaushikg -Frep:kaushik http://localhost:4502/libs/granite/security/post/authorizables
How to change the admin password??
localhost:4502/crx/dexplorer/index.jsp > Node type administration > there is an option called security > change password
this is definite task for admin.
Where to know how user got added??
localhost:4502/crx/de/index.jsp
to increase your security they store user in the different formats part of the oak architecture

——————————————————————————————————————————————————
Naming of user nodes:
/home/users
it is a part of oak security
they made it has a  random authorizable modes
so whenever i create a user by name paramesh  and  the node name is p and it is named as paramesh.this is because of security feature in oak they made it has the random authorizable modes.
inorder to avoid the  components breaking whenever you add the user we deal with random authorizable nodes.

Inorder to remove the random authorizable node name, we have to remove the components in the osgi  bundles ,whenever the team says regarding this and we feel that it is not working, it is better to disable that feature.(just go to that osgi component and disable it).
After that go and create an user:
we can create the user using the curl commands or we can  create the user in the user admin.
Below are the references:
to change the random  authorizable node name
osgi config -Disable  the random authorizable component
or 
to change the length of the name  — Random authorizable  osgi config.
(it consists of the alogirthm running in the backend that is nothing but the random  generation algorithm).
———————————————————————————————————————————————————
To change the security password
go to crx/explorer  — choose security option and set password.
————————————————————————————————————————————————————
Real time blogs for curl command:
www.aemcq5tutorials/adobe-cq5-aem-curl-commands/
————————————————————————————————————————
How to build a bundle here??
step1:we have to provide the location of the bundle descriptor here.
to stop the bundle and to start the bundle, below are the following commands.
step2:whenever your using the start and stop of the bundle we need to just replace the command with the help of the symbolic name.


No comments:

Post a Comment