Categories
401k and Personal Finance

GCP Cloud Storage and PCF

Reading Time: < 1 minute

Tried two two tutorials on my personal GCP.

hello world


cloud storage (upload a file, then return a public url for download; another download link)

I may delete those bucket and files later on, as hosting costs money (app engine, cloud storage). Update: I disabled the app (here is one article talking about disable / delete app engine app). In simple term: I go to project, app engine, go to settings, click disable. Btw, I noticed all 73 cents charges for about 20 hours is from app engine.

From GCP Console Dashboard, I saw Resource

App Engine
2 versions
Storage
4 buckets

GCP Service Broker

For PCF, the approach above did not work (got an error on line 61 on the example above). I followed the steps for GCP service broker and pushed it to our pcf.

Virus Scan

Automating malware scanning for documents uploaded to Cloud Storage

PCF Sample App

It looks like with the VMWare Pivotal acquisition / integration, their hello world sample app website also moved. Here is the new link.

Categories
Software development

GCP Cloud SQL hibernate issue

Reading Time: < 1 minute

It complains the table does not exist when in the data.sql we were trying to insert some data. Turns out the table did exist but the default table name was lower case, while we were using Upper case both in the data.sql and the java hibernate entity. The fix is to add one line in the application.properties file. Note this is a spring boot app. Also note the data.sql was used to load initial data in spring boot.

spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

I found out about it as I first work around the issue by doing something like shown in this article. But I was thinking this was not right. I was able to find out once I connect to the cloud sql db via proxy. Also refer to this stackoverflow discussion. 

DROP TABLE IF EXISTS employee;

CREATE TABLE employee (
  empId VARCHAR(10) NOT NULL,
  empName VARCHAR(100) NOT NULL
);

Also Spring Data

Spring data REST reference: this is by default will be shown in the root of the website.

the key seems to be adding this in pom:

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-rest</artifactId> </dependency>

Last but not least, to disable the end points or to show the available ends points for spring boot app, we can use actuator.

management.endpoints.web.exposure.include=mappings

We can show the end points at:

/actuator/mappings