how to provide default value for anlytics to jhipster command? - jhipster

I am trying to build the jhipster automatically, kindly help me to give a default value to analytics while building the jhipster file.
jhipster jdl file.jdl --no-insight
Above command will build and monolith application, after some steps it asks a question for analytics, how do you provide a default value to anlytics in jhipster command or jdl file ?
Insights question
Analytics question
I see below options, but I dont see anything for anlytics
-V, --version output the version number
--blueprints <value> A comma separated list of one or more generator blueprints to use for the sub generators, e.g. --blueprints kotlin,vuejs
--force-insight Force insight
--no-insight Disable insight
--force Override every file (default: false)
--dry-run Print conflicts (default: false)
--whitespace Whitespace changes will not trigger conflicts (default: false)
--bail Fail on first conflict (default: false)
--skip-regenerate Don't regenerate identical files (default: false)
--skip-yo-resolve Ignore .yo-resolve files (default: false)
-d, --debug enable debugger
-h, --help display help for command

Set an env variable as export NG_CLI_ANALYTICS=ci before we run jhipster jdl app.jdl --no-insight

Related

Kubernetes integration with Dynatrace, dynatrace-webhook throwing an error

dynatrace-operator running fine, but dynatrace-webhook pod logs showing error message.
how to find the OneAgentAPM ? and how to delete it ,manually ?Any help please.
kubectle logs -f pods/dynatrace-webhook-58975cf6bb-hgs4x
{"level":"info","ts":"2022-10-29T04:01:43.627Z","logger":"dynatrace-operator-version","msg":"dynatrace-operator","version":"v0.9.0","gitCommit":"99a1efbe21f7bf566be7412fe20d61a489d6333c","buildDate":"2022-09-28T13:57:47+00:00","goVersion":"go1.19.1","platform":"linux/amd64"}
{"level":"info","ts":"2022-10-29T04:01:44.243Z","logger":"main.controller-runtime.metrics","msg":"Metrics server is starting to listen","addr":":8383"}
{"level":"info","ts":"2022-10-29T04:01:44.282Z","logger":"main.controller-runtime.webhook","msg":"Registering webhook","path":"/label-ns"}
Error: OneAgentAPM object detected - the Dynatrace webhook will not inject until the deprecated OneAgent Operator has been fully uninstalled
Usage:
dynatrace-operator webhook-server [flags]
Flags:
--cert string File name for the public certificate. (default "tls.crt")
--cert-key string File name for the private key. (default "tls.key")
--certs-dir string Directory to look certificates for. (default "/tmp/webhook/certs")
-h, --help help for webhook-server
{"level":"info","ts":"2022-10-29T04:01:44.845Z","logger":"main.events","msg":"Unsupported OneAgentAPM CRD still present in cluster, please remove to proceed","type":"Warning","object":{"kind":"Pod","namespace":"dynatrace","name":"dynatrace-webhook-58975cf6bb-hgs4x","uid":"008d0262-8df3-4410-94f0-fbb50167b6cd","apiVersion":"v1","resourceVersion":"92860179"},"reason":"IncompatibleCRDPresent"}
{"level":"info","ts":"2022-10-29T04:01:44.846Z","logger":"main","msg":"OneAgentAPM object detected - the Dynatrace webhook will not inject until the deprecated OneAgent Operator has been fully uninstalled"}
I trying to find the way to find the OneAgentAPM Object and delete it.
We were using different version of operator and agent.
You probably have some old CRD that is causing the issue. Try to remove the operator, show all CRDs in the cluster and look for Dynatrace OneAgent CRDs. Just delete these CRDs and reinstall OneAgent operator. In my case, I had to delete these two: oneagents.dynatrace.com and oneagentapms.dynatrace.com

jhipster openapi-client , failed to genereate client code

i'd like to generate code basing on openapi yaml file from jhipster, refering https://www.jhipster.tech/doing-api-first-development/ i have done this:
D:\dev\jhipster-app\openapi-demo>jhipster openapi-client
INFO! Using JHipster version installed globally
INFO! Executing jhipster:openapi-client
Welcome to the JHipster OpenApi client Sub-Generator
? Where do you want to import your OpenAPI/Swagger specification from ? From a custom specification file or endpoint
? Where is your Swagger/OpenAPI spec (URL or path) ? http://petstore.swagger.io/v2/swagger.json
? What is the unique name for your API client (please avoid using Java keywords) ? petstore
? Do you want to save this config for future reuse ? No
and it prompts the error:
Unable to find package.json. Reference to npm script (name: openapi-client:petstore, data:openapi-generator generate -g spring -i http://petstore.swagger.io/v2/swagger.json -p library=spring-cloud -p apiPackage=undefined.client.petstore.api -p modelPackage=undefined.client.petstore.model -p basePackage=undefined.client -p configPackage=undefined.client.petstore -p title=petstore -p artifactId=petstore -p supportingFiles=ApiKeyRequestInterceptor.java --skip-validate-spec) not added.
ERROR! Cannot read property 'endsWith' of undefined
TypeError: Cannot read property 'endsWith' of undefined
at module.exports.getMicroserviceAppName (D:\users\dev\npm\node_modules\generator-jhipster\generators\generator-base.js:1252:66)
Would someone have any idea to fix it?
I download the sample pestore.yaml from swagger and put it to an existing project 's "src/main/resources/swagger/" folder with renaming to api.yml.
and run jhipster openapi-client:
INFO! Using JHipster version installed locally in current project's node_modules
INFO! No custom sharedOptions found within blueprint: generator-jhipster-vuejs at /mnt/program/dev/github/jhipster-app/vuedemo/node_modules/generator-jhipster-vuejs
INFO! No custom commands found within blueprint: generator-jhipster-vuejs at /mnt/program/dev/github/jhipster-app/vuedemo/node_modules/generator-jhipster-vuejs
INFO! Executing jhipster:openapi-client
Welcome to the JHipster OpenApi client Sub-Generator
? What do you want to do ? Generate a new API client
? Where do you want to import your OpenAPI/Swagger specification from ? From the api.yml spec of an existing Jhipster project
? Enter the path to the jhipster project root directory /program/github/jhipster-app/vuedemo
? What is the unique name for your API client (please avoid using Java keywords) ? petstore
? Do you want to save this config for future reuse ? No
the result seems ok:
Generating npm script for generating client code petstore (/program/github/jhipster-app/vuedemo/src/main/resources/swagger/api.yml)
identical .openapi-generator-ignore
identical pom.xml
identical src/main/java/com/demo/VuedemoApp.java
identical package.json
force .yo-rc.json
Generating client for petstore
> vuedemo#0.0.0 openapi-client:petstore /mnt/program/dev/github/jhipster-app/vuedemo
> openapi-generator generate -g spring -i /program/github/jhipster-app/vuedemo/src/main/resources/swagger/api.yml -p library=spring-cloud -p apiPackage=com.demo.client.petstore.api -p modelPackage=com.demo.client.petstore.model -p basePackage=com.demo.client -p configPackage=com.demo.client.petstore -p title=petstore -p artifactId=petstore -p supportingFiles=ApiKeyRequestInterceptor.java --skip-validate-spec
Usage: openapi-generator [options] [command]
Options:
-V, --version output the version number
-d, --sdkDir <sdkDir> sdkDir, default: process.cwd()/service
-t, --templatePath <templatePath> templatePath
-t, --type <type> ts/js, default ts
-c, --camelCase <camelCase> filename style, true 为大驼峰,lower 为小驼峰
-d, --sdkDir <sdkDir> sdkDir, default: process.cwd()/service
-t, --templatePath <templatePath> templatePath
-t, --type <type> ts/js, default ts
-c, --camelCase <camelCase> filename style, true 为大驼峰,lower 为小驼峰
-h, --help output usage information
Commands:
url <url> swagger2/oas3 json data url
data <filePath> swagger2/oas3 json data file
config <cfgPath> config path
*
✔ Succesfully generated petstore spring client
End of openapi-client generator
INFO! Congratulations, JHipster execution is complete!
but I can't find any code generated in src/main/webapp
jhipster openapi-client generate java code for the server, not typescript code for the client :(

Generating a default config SIMP file

I am on a RHEL 7.7 instance that uses SIMP. I am trying to generate a default configuration (YAML) file.
Directly from the SIMP docs:
You can use the --dry-run option to step through the questions without changing anything and then run simp config -a /root/.simp/simp_conf.yaml to apply the changes.
And further down:
If you want to understand what variables apply to your setup, run simp config --dry-run and examine the generated simp_conf.yaml file. That file will contain both the settings and their documentation.
I've tried doing so via:
simp config --dry-run
simp config --dry-run -o default_simp_config.yaml
simp config --dry-run -f -o default_simp_config.yaml
No file is generated as a result of any of these commands. What am I missing?
Info:
# simp version
5.1.0
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.7 (Maipo)
It looks like this is a bug in the output of simp config.
When running simp config --dry-run, you should see something like the following header:
================================================================================
`simp config` will take you through preparing your infrastructure for bootstrap
based on a pre-defined SIMP scenario you select. These preparations include
optional and required general system setup and required Puppet configuration.
All changes will be logged to
/root/.simp/simp_conf.log.20200128T140045
First, `simp config` will ensure you have a SIMP omni-environment in place.
Then, you will be prompted to enter setup information. Each prompt will be
prefaced by a detailed description of the information requested, along with the
OS value and/or recommended value for that item, if available.
At any time, you can exit `simp config` by entering <CTRL-C>. By default,
if you exit early, the configuration you entered will be saved to
/root/.simp/.simp_conf.yaml
The next time you run `simp config`, you will be given the option to continue
where you left off or to start all over.
================================================================================
Note, that the save file is noted as /root/.simp/.simp_conf.yaml instead of /root/.simp/.simp_conf.yaml as specified in the referenced documentation.
This appears to be a bug where a leading dot . is being added to the output file in all cases and has been submitted as SIMP-7533

Can I execute presto CLI without specifying --server or --catalog

I would like to know where, if it is possible, I can configure default catalog and server values to use when executing the presto CLI.
Presto CLI info:
ls -lthr /opt/presto-server-0.169/presto
/opt/presto-server-0.169/presto -> presto-cli-0.169-executable.jar
And instead of executing:
/opt/presto-server-0.169/presto --server localhost:6666 --schema abc --catalog catalog-1
I would like to execute:
/opt/presto-server-0.169/presto
with it picking up localhost:6666 as my server and catalog-1 as my catalog. I would like to specify the schema once I make the connection.
Any help will be appreciated!
Thanks.
There is no such option to set host in console lazily. The server needs to be defined upfront by default localhost:8080 is used.
If you cannot pass proper arguments to the presto-cli and cannot use the default server host, you can change default values in presto-cli source code and compile your version.
You need to checkout project at github.
Change default values in ClientOptions.
Package jar for presto cli: cd presto-cli && mvn package
You can find a jar in target/presto-cli-0.201-SNAPSHOT.jar
For schema/catalog, you can define it in the console itself with USE command. The syntax as follows: USE [<catalog>.]<schema>.
Please note that with each version of presto you need also compile and maintain your own version of presto-cli, which might become a burden quite soon.

JAVA_HOME for Logstash

I am trying to setup ELK stack for my Web Services Log Monitoring.
So I have setup all the parts for ELK Stack.
I am facing one issue in Log-stash. When I am running Log-stash, I am facing error, could not load Java binary
Although the simple fix it set the JAVA_HOME in environment variable.
But I don't want to set an environment variable, but what I want to set JAVA_HOME just for Log-stash. I have tried adding in startup.options, but to enable I must run system-install. When I am running system-install, I am facing the same error again.
I have added
export JAVA_HOME=/opt/jre8
then system-install file runs, but still on starting log-stash, I am getting the same error. What should I do to resolve this error?
You can config in startup.options (logstash5.4 version):
Ex:
JAVA_HOME=/.../jdk1.8.0_121
JAVACMD=/.../jdk1.8.0_121/bin/java
Then use root role to start: system-install.
(You can use update-java-alternatives --list to list installed java versions with paths)
You can add this configuration to the file- /etc/sysconfig/logstash, this file is read during startup by logstash.
This is what you should add:
export JAVA_HOME=/opt/jre8

Resources