I am trying to create organizations in grafana through API calls. but i was getting some error on user and password related. but i used to login through basic authentication only. could you please help me anyone on this to figure out.
i used separate istio ingress-gateway and virtual service to hit the grafana.
grafana version : 7.5.3
istio-gateway:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: grafana-gateway
namespace: istio-system
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- grafana.aws-digital.cffs.com
port:
name: http
number: 80
protocol: HTTP
- hosts:
- grafana.aws-digital.cffs.com
port:
name: https
number: 443
protocol: HTTPS
tls:
credentialName: istio-tls-cert
minProtocolVersion: TLSV1_2
mode: SIMPLE
virtual-service:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: grafana-virtual-svc
namespace: default
spec:
hosts:
- grafana.aws-digital.cffs.com
gateways:
- istio-system/grafana-gateway
http:
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 3000
host: prometheus-default-grafana
the curl command i used to create organizations in grafana :
curl --location --request POST 'https://grafana.aws-igital.cffs.com/ops/portal/grafana/admin/orgs'
--header 'Host: grafana.aws-digital.cffs.com'
--header 'Accept-Encoding: application/json'
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--header 'Authorization: Basic YWRtaW46cHJvbS1vcGVyYXRvcg=='
--data-raw '{
"name":"test"
}'
i added all headers and in body i added only org name. all looking fine but i was getting this error :
[{"fieldNames":["User"],"classification":"RequiredError","message":"Required"},{"fieldNames":["Password"],"classification":"RequiredError","message":"Required"}]
can anyone help me where i did mistake. your response will be appreciated. thank you