{"id":56416,"date":"2023-01-14T22:48:27","date_gmt":"2023-01-14T17:18:27","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=56416"},"modified":"2024-01-02T17:42:03","modified_gmt":"2024-01-02T12:12:03","slug":"fooling-around-with-docker-cli-commands-with-postgresql-image","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/fooling-around-with-docker-cli-commands-with-postgresql-image\/","title":{"rendered":"Fooling around with Docker CLI commands with PostgreSQL image"},"content":{"rendered":"<p><strong><span class=\"y ade adf adg jb adh adi adj adk adl ct\">C<\/span><\/strong>urrently, I am developing a side project wherein I wanted to use Postgres as my project database using its docker image. This blog is my brain dump of the docker basics I have learned so far, and I have attempted to break down the CLI commands I used or came across during the course of development for my own better understanding.<\/p>\n<p id=\"4cb7\" class=\"adm adn abm bu wi qj ado qk qn qo adp qp qs acq adq adr qx acu ads adt rc acy adu adv rh adw bx\">We\u2019ll start with simple basics like:<\/p>\n<ol class=\"\">\n<li id=\"d6b7\" class=\"adx ady abm rj b ack adz acn aea acq aeb acu aec acy aed adc aee aef aeg dz bx\" data-selectable-paragraph=\"\">Docker: A definition<\/li>\n<li id=\"3138\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\">Docker Image<\/li>\n<li id=\"b70a\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\">Docker Container<\/li>\n<\/ol>\n<p>Feel free to skip these sections if you know these concepts already. Finally, I\u2019ll explain how you can download Postgres images from the docker hub, and we will jump right into CLI Commands.<\/p>\n<blockquote><p>Note: Please note that this blog assumes that you have docker already installed in your system. If not, then you can download it from\u00a0<a class=\"ax aet\" href=\"https:\/\/docs.docker.com\/get-docker\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">here<\/a>.<\/p><\/blockquote>\n<h3 id=\"df47\" class=\"aeu adn abm bu wi aev aew aex qn aey aez afa qs qt afb qu qx qy afc qz rc rd afd re rh afe bx\">Docker: A definition<\/h3>\n<p id=\"6e40\" class=\"pw-post-body-paragraph aci acj abm rj b ack adz vp acm acn aea vs acp acq aff acs act acu afg acw acx acy afh ada adb adc oe bx\" data-selectable-paragraph=\"\">Docker is an open-source project for building the shipping and running programs. It is a command line program, a background process and a set of remote services that simplifies your experience of installing, running, publishing and removing a software.<\/p>\n<p id=\"901a\" class=\"pw-post-body-paragraph aci acj abm rj b ack acl vp acm acn aco vs acp acq acr acs act acu acv acw acx acy acz ada adb adc oe bx\" data-selectable-paragraph=\"\">It accomplishes this by using something called\u00a0<em class=\"aep\">containers.<\/em><\/p>\n<h3 id=\"85f9\" class=\"aeu adn abm bu wi aev aew aex qn aey aez afa qs qt afb qu qx qy afc qz rc rd afd re rh afe bx\">Docker Image<\/h3>\n<p id=\"599d\" class=\"pw-post-body-paragraph aci acj abm rj b ack adz vp acm acn aea vs acp acq aff acs act acu afg acw acx acy afh ada adb adc oe bx\" data-selectable-paragraph=\"\">An\u00a0<em class=\"aep\">image\u00a0<\/em>is a program bundled\/packaged together with the dependencies required to run that program.<\/p>\n<h3 id=\"5b2b\" class=\"aeu adn abm bu wi aev aew aex qn aey aez afa qs qt afb qu qx qy afc qz rc rd afd re rh afe bx\">Docker Container<\/h3>\n<p id=\"414b\" class=\"pw-post-body-paragraph aci acj abm rj b ack adz vp acm acn aea vs acp acq aff acs act acu afg acw acx acy afh ada adb adc oe bx\" data-selectable-paragraph=\"\">A\u00a0<em class=\"aep\">container\u00a0<\/em>is a running instance of an image. The running state of a container is directly tied to the running state of the program inside the container. Unlike virtual machines, Docker containers do not use any hardware virtualization.<\/p>\n<blockquote>\n<p data-selectable-paragraph=\"\">Docker is not a hardware virtualization technology but it helps you use container technology already built into your operating system kernel.<\/p>\n<\/blockquote>\n<p data-selectable-paragraph=\"\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1iR14yJj3si3sT29he0UvhA.png\" width=\"803\" height=\"393\" \/><\/p>\n<h3 id=\"66d9\" class=\"aeu adn abm bu wi aev aew aex qn aey aez afa qs qt afb qu qx qy afc qz rc rd afd re rh afe bx\">Run Postgres image locally using docker<\/h3>\n<pre>docker pull postgres:&lt;version&gt;\r\n\r\n<span class=\"hljs-comment\">#Example<\/span>\r\ndocker pull postgres:15.1\r\n\r\n<\/pre>\n<p id=\"d2f6\" class=\"pw-post-body-paragraph aci acj abm rj b ack acl vp acm acn aco vs acp acq acr acs act acu acv acw acx acy acz ada adb adc oe bx\" data-selectable-paragraph=\"\">You can checkout the available image versions at\u00a0<a class=\"ax aet\" href=\"https:\/\/hub.docker.com\/_\/postgres\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/hub.docker.com\/_\/postgres<\/a>.<\/p>\n<p id=\"d8e8\" class=\"pw-post-body-paragraph aci acj abm rj b ack acl vp acm acn aco vs acp acq acr acs act acu acv acw acx acy acz ada adb adc oe bx\" data-selectable-paragraph=\"\">Start the postgres instance on docker along with its Port Mapping:<\/p>\n<pre>docker run --name &lt;container_name&gt; -e POSTGRES_USER=root -e POSTGRES_PASSWORD=root -p 5432:5432 -d postgres:&lt;version&gt;\r\n\r\n<span class=\"hljs-comment\">#example:<\/span>\r\ndocker run --name myPostgres -e POSTGRES_USER=root -e POSTGRES_PASSWORD=root -p 5432:5432 -d postgres:15.1<\/pre>\n<p>This command returns a long unique ID:<\/p>\n<p><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1_4agSjfnUNmZK4SEkHLViA.png\" \/><\/p>\n<p id=\"bf26\" class=\"pw-post-body-paragraph aci acj abm rj b ack acl vp acm acn aco vs acp acq acr acs act acu acv acw acx acy acz ada adb adc oe bx\" data-selectable-paragraph=\"\">Let\u2019s break this down:<\/p>\n<ol class=\"\">\n<li id=\"7d06\" class=\"adx ady abm rj b ack acl acn aco acq agg acu agh acy agi adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">run<\/code>\u00a0command looks for the image locally or remotely(<strong class=\"rj mx\"><em class=\"aep\">docker hub<\/em><\/strong>\u00a0which is a public docker repository). If found,\u00a0<code class=\"em agj agk agl afu b\">run<\/code>\u00a0installs the image if it isn\u2019t already. Finally, it creates and starts the container immediately.<\/li>\n<li id=\"2b73\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">-d<\/code>\u00a0flag is used for telling the docker to run the container in the background or detached mode<\/li>\n<li id=\"405a\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">-e<\/code>\u00a0flag is used for passing the environment variables if we want to customise the containers by passing environment variables like\u00a0<code class=\"em agj agk agl afu b\">POSTGRES_USER<\/code>\u00a0or\u00a0<code class=\"em agj agk agl afu b\">POSTGRES_PASSWORD<\/code>\u00a0. Similarly, the environment variable\u00a0<code class=\"em agj agk agl afu b\">POSTGRES_DB<\/code>\u00a0can be used to define the name of the database. If name is not defined, the\u00a0<code class=\"em agj agk agl afu b\">POSTGRES_USER<\/code>\u00a0is taken as default name for database.<\/li>\n<li id=\"1bdd\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">5432:5432<\/code>\u00a0is the port mapping of the running instance. Docker container runs in a separate virtual network which is different from the host network that we are on. So we cannot simply connect to the postgres server running on the port 5432 of the container network unless we tell docker to create a kind of a bridge between our localhost network and the container\u2019s network. We do that by using the\u00a0<code class=\"em agj agk agl afu b\">-p<\/code>\u00a0flag (which means port), then specify the port of the host network followed by a colon, then the corresponding port of the container network :<br \/>\n<code class=\"em agj agk agl afu b\">-p &lt;host_network_port&gt;:&lt;container_network_port&gt;<\/code>.\u00a0<strong class=\"rj mx\">Example:<\/strong>\u00a0<code class=\"em agj agk agl afu b\">-p 5432:5432<\/code>\u00a0.<br \/>\n<code class=\"em agj agk agl afu b\">&lt;host_network_port&gt;<\/code>\u00a0and\u00a0<code class=\"em agj agk agl afu b\">&lt;container_network_port&gt;<\/code>\u00a0cannot necessarily be the same but we can set the same port for the sake of convenience while developing locally.<\/li>\n<\/ol>\n<blockquote><p><em>A container is an instance of the application contained in the image which can be started by\u00a0<code class=\"em agj agk agl afu b\">docker run<\/code>\u00a0command. We can start multiple containers from one single image.<\/em><\/p><\/blockquote>\n<p>Run the following command to list the containers:<\/p>\n<pre>\/\/This will list all the running containers\r\ndocker ps \r\n\r\n\/\/or \r\n\r\n\/\/This will list all the containers regardless of their status(active or inactive)\r\ndocker ps -a<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1jh56RL0YOvp8OWuQlOmXBg.png\" width=\"849\" height=\"76\" \/><br \/>\nVoila ?, our container is running!<\/p>\n<h3 id=\"a4ab\" class=\"aeu adn abm bu wi aev aew aex qn aey aez afa qs qt afb qu qx qy afc qz rc rd afd re rh afe bx\">Connecting to Postgres container console:<\/h3>\n<p id=\"9f96\" class=\"pw-post-body-paragraph aci acj abm rj b ack adz vp acm acn aea vs acp acq aff acs act acu afg acw acx acy afh ada adb adc oe bx\" data-selectable-paragraph=\"\">Now that the postgres server is ready, we can connect to it and access its console by using the\u00a0<code class=\"em agj agk agl afu b\">docker exec<\/code>\u00a0command as follows:<\/p>\n<pre>\/\/ syntax: docker <span class=\"hljs-built_in\">exec<\/span> -it &lt;CONTAINER_NAME_OR_ID&gt; &lt;CMD&gt; -U &lt;USER&gt;\r\n\r\ndocker <span class=\"hljs-built_in\">exec<\/span> -it myPostgres psql -U root<\/pre>\n<p>The <code class=\"em agj agk agl afu b\">docker exec<\/code>\u00a0command runs or \u201cExecutes\u201d a new command in a running container.<\/p>\n<p id=\"fc22\" class=\"pw-post-body-paragraph aci acj abm rj b ack acl vp acm acn aco vs acp acq acr acs act acu acv acw acx acy acz ada adb adc oe bx\" data-selectable-paragraph=\"\">Lets take a deep dive:<\/p>\n<ol class=\"\">\n<li id=\"2744\" class=\"adx ady abm rj b ack acl acn aco acq agg acu agh acy agi adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">-it<\/code>\u00a0flag tells docker to run the command as an interactive TTY**(terminal = tty = text input\/output environment)** session<\/li>\n<li id=\"ef15\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">psql<\/code>\u00a0will enable us to access the postgres console<\/li>\n<li id=\"ccd2\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">-U<\/code>\u00a0flag tells the\u00a0<code class=\"em agj agk agl afu b\">psql<\/code>\u00a0that we want to connect with the\u00a0<code class=\"em agj agk agl afu b\">root<\/code>\u00a0user<\/li>\n<li id=\"48c9\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\">In localhost, postgres container doesn\u2019t need a password as postgres image sets up\u00a0<code class=\"em agj agk agl afu b\">Trust<\/code>\u00a0Authentication mechanism for authenticating a user. However, a password will be needed if connecting from a different host or container.<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1uSCguQ8gBANs6s9g98Eu9Q.png\" \/><\/p>\n<p>That worked well!! \ud83d\ude42<\/p>\n<h3 id=\"9c56\" class=\"aeu adn abm bu wi aev aew aex qn aey aez afa qs qt afb qu qx qy afc qz rc rd afd re rh afe bx\">Connecting to the container shell:<\/h3>\n<p id=\"1cfb\" class=\"pw-post-body-paragraph aci acj abm rj b ack adz vp acm acn aea vs acp acq aff acs act acu afg acw acx acy afh ada adb adc oe bx\" data-selectable-paragraph=\"\">The shell for postgres running container can be accessed through the following command:<\/p>\n<pre>docker <span class=\"hljs-built_in\">exec<\/span> -it &lt;CONTAINER_NAME&gt; &lt;EXECUTABLE&gt;\r\n\r\n<span class=\"hljs-comment\">#example<\/span>\r\ndocker <span class=\"hljs-built_in\">exec<\/span> -it myPostgres \/bin\/sh<\/pre>\n<p data-selectable-paragraph=\"\">This gives us access to all the linux commands.<\/p>\n<blockquote>\n<p data-selectable-paragraph=\"\"><em><code class=\"em agj agk agl afu b\">\/bin\/sh<\/code>\u00a0is an executable representing the system shell and usually implemented as a symbolic link pointing to the executable for whichever shell is the system shell. The system shell is basically the default shell that the script should use.<\/em><\/p>\n<\/blockquote>\n<p data-selectable-paragraph=\"\"><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1DNVCXtnQWe9trlbtrp0ugg.png\" \/><\/p>\n<p data-selectable-paragraph=\"\">woohooo.. I can run linux commands on my container shell<\/p>\n<h3 id=\"6023\" class=\"adm adn abm bu wi qj ado qk qn qo adp qp qs acq adq adr qx acu ads adt rc acy adu adv rh adw bx\">Using shell to execute database commands:<\/h3>\n<p id=\"8b8c\" class=\"pw-post-body-paragraph aci acj abm rj b ack adz vp acm acn aea vs acp acq aff acs act acu afg acw acx acy afh ada adb adc oe bx\" data-selectable-paragraph=\"\">We can use the shell to execute the database commands<\/p>\n<pre>createdb --username=&lt;USERNAME&gt; --owner=&lt;USERNAME&gt; &lt;DB_NAME&gt;\r\n\r\n<span class=\"hljs-comment\">#Example<\/span>\r\ncreatedb --username=root --owner=root test_database<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1kGQBIa1RVYJO6HCRI6naNA.png\" width=\"857\" height=\"569\" \/><\/p>\n<p>I can see a newly created test_database on \u201c<a class=\"ax aet\" href=\"https:\/\/tableplus.com\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">TablePlus<\/a>\u201d database list<\/p>\n<p>Just like\u00a0<code class=\"em agj agk agl afu b\">createdb<\/code>\u00a0, you can\u00a0<em class=\"aep\">drop<\/em> your database using the command <code class=\"em agj agk agl afu b\">dropdb &lt;DB_NAME&gt;<\/code>\u00a0inside the shell.<\/p>\n<p><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1UKRYIn7zXGbM7kKGwT7hbg.png\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1m2njxdgXRQRcjgYzd9cJMQ.png\" width=\"852\" height=\"566\" \/><\/p>\n<blockquote><p><em>You can use the\u00a0<code class=\"em agj agk agl afu b\">exit<\/code>\u00a0command to come out of the container shell.<\/em><\/p><\/blockquote>\n<p>Now from outside the container, we chain the\u00a0<code class=\"em agj agk agl afu b\">createdb<\/code>\u00a0command directly with the\u00a0<code class=\"em agj agk agl afu b\">docker exec<\/code>\u00a0command:<\/p>\n<pre>docker <span class=\"hljs-built_in\">exec<\/span> -it &lt;CONTAINER_NAME&gt; createdb --username=root --owner=root &lt;DB_NAME&gt;\r\n\r\n<span class=\"hljs-comment\">#Example<\/span>\r\ndocker <span class=\"hljs-built_in\">exec<\/span> -it myPostgres createdb --username=root --owner=root test_database<\/pre>\n<p>Similarly, other database operations can be chained with\u00a0<code class=\"em agj agk agl afu b\">docker exec<\/code>\u00a0command like:<\/p>\n<pre><span class=\"hljs-comment\">#Example 1<\/span>\r\ndocker <span class=\"hljs-built_in\">exec<\/span> -it myPosygres dropdb test_database\r\n\r\n<span class=\"hljs-comment\">#Example 2 : if you want to access postgres console of test_database<\/span>\r\ndocker <span class=\"hljs-built_in\">exec<\/span> -it myPostgres psql test_database<\/pre>\n<p><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1FWGKP7rpyE1JCBSe3soKqg.png\" \/><\/p>\n<h3 id=\"ecc7\" class=\"aeu adn abm bu wi aev aew aex qn aey aez afa qs qt afb qu qx qy afc qz rc rd afd re rh afe bx\">Some more useful commands:<\/h3>\n<ol class=\"\">\n<li id=\"668e\" class=\"adx ady abm rj b ack adz acn aea acq aeb acu aec acy aed adc aee aef aeg dz bx\" data-selectable-paragraph=\"\">If you want to stop a running container, you can use the following command:\u00a0<code class=\"em agj agk agl afu b\">docker stop &lt;CONTAINER_NAME_OR_ID&gt;<\/code><\/li>\n<li id=\"a184\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\">If you want to run a container again, you can use the following command:\u00a0<code class=\"em agj agk agl afu b\">docker start &lt;CONTAINER_NAME_OR_ID&gt;<\/code><\/li>\n<li id=\"9417\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\">If you have stopped your container and you want to completely remove it, you can run the following command:\u00a0<code class=\"em agj agk agl afu b\">docker rm &lt;CONTAINER_NAME&gt;<\/code>\u00a0. This command will not work unless you have stopped your container.<\/li>\n<\/ol>\n<h3 id=\"64e0\" class=\"aeu adn abm bu wi aev aew aex qn aey aez afa qs qt afb qu qx qy afc qz rc rd afd re rh afe bx\">Difference between docker create, start and run:<\/h3>\n<p id=\"af5f\" class=\"pw-post-body-paragraph aci acj abm rj b ack adz vp acm acn aea vs acp acq aff acs act acu afg acw acx acy afh ada adb adc oe bx\" data-selectable-paragraph=\"\">Here\u2019s what these commands do:<\/p>\n<ol class=\"\">\n<li id=\"d7ee\" class=\"adx ady abm rj b ack acl acn aco acq agg acu agh acy agi adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">docker create<\/code><strong class=\"rj mx\">\u00a0command<\/strong>\u00a0creates a fresh new container from a docker image. However, it doesn\u2019t run it immediately.<\/li>\n<li id=\"b594\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">docker start<\/code><strong class=\"rj mx\">\u00a0command<\/strong>\u00a0will start any stopped container. If you used docker create command to create a container, you can start it with this command.<\/li>\n<li id=\"b568\" class=\"adx ady abm rj b ack aeh acn aei acq aej acu aek acy ael adc aee aef aeg dz bx\" data-selectable-paragraph=\"\"><code class=\"em agj agk agl afu b\">docker run<\/code><strong class=\"rj mx\">\u00a0command<\/strong>\u00a0is a combination of create and start as it creates a new container and starts it immediately. In fact, the docker run command can even pull an image from Docker Hub if it doesn\u2019t find the mentioned image on your system.<\/li>\n<\/ol>\n<h3 id=\"ba19\" class=\"aeu adn abm bu wi aev agy aex qn aey agz afa qs qt aha qu qx qy ahb qz rc rd ahc re rh afe bx\">Note of thanks \u2764\ufe0f<\/h3>\n<p>Thank you for stopping by. Hope, you find this article useful. If you do, please\u00a0<a class=\"ax aet\" href=\"https:\/\/medium.com\/@shiva.chaturvedi91\" rel=\"noopener\"><strong class=\"rj mx\"><em class=\"aep\">follow me<\/em><\/strong><\/a>\u00a0on medium. That will truly encourage me to put out more content.<\/p>\n<blockquote><p>P.S.: If you feel something can be improved or lacks proper explanation, drop me a note in the comment box or mail me at\u00a0<a class=\"ax aet\" href=\"mailto:shiva.chaturvedi91@gmail.com\" target=\"_blank\" rel=\"noopener ugc nofollow\">shiva.chaturvedi91@gmail.com<\/a>. After all, you can teach me a thing or two as well.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Currently, I am developing a side project wherein I wanted to use Postgres as my project database using its docker image. This blog is my brain dump of the docker basics I have learned so far, and I have attempted to break down the CLI commands I used or came across during the course of [&hellip;]<\/p>\n","protected":false},"author":1535,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":5},"categories":[1174,2348,4839,1],"tags":[1892,1883,5080,942,2591],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/56416"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1535"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=56416"}],"version-history":[{"count":4,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/56416\/revisions"}],"predecessor-version":[{"id":59777,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/56416\/revisions\/59777"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=56416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=56416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=56416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}