This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, jsonify | |
from dotenv import load_dotenv | |
import json | |
from datetime import datetime | |
import os | |
from src.model import Product # Import the Product class | |
from src.couchbase_client import CouchbaseClient # Import the CouchbaseClient class | |
load_dotenv(dotenv_path="config/.env") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
from datetime import datetime | |
@dataclass | |
class Product: | |
id: str | |
description: str | |
price: float | |
status: str | |
created_at: datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from couchbase.options import ClusterOptions # Updated import | |
from couchbase.cluster import Cluster | |
from couchbase.auth import PasswordAuthenticator | |
from couchbase.exceptions import CouchbaseException, DocumentExistsException # Import the exception | |
from couchbase.collection import UpsertOptions | |
class CouchbaseClient: | |
def __init__(self, connection_string, username, password, bucket_name): | |
""" | |
Initialize the Couchbase client. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONNECTION_STRING=couchbase://localhost | |
USERNAME=session_pc | |
PASSWORD=session_pc | |
BUCKETNAME=session_pc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sonar.host.url=http://localhost:9000/ | |
sonar.login=<YOUR_LOGIN> | |
sonar.password=<YOUR_PASSWORD> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import uuid | |
from datetime import datetime | |
from dotenv import load_dotenv | |
from couchbase.exceptions import DocumentExistsException | |
from src.cb import CouchbaseClient | |
from flask import Flask, request, jsonify | |
from flask_restx import Api, Resource, fields | |
from mailjet_rest import Client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from couchbase.auth import PasswordAuthenticator | |
from couchbase.cluster import Cluster | |
from couchbase.diagnostics import PingState | |
from couchbase.exceptions import ( | |
CouchbaseException, | |
DocumentExistsException, | |
DocumentNotFoundException, | |
) | |
from couchbase.options import ClusterOptions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_HOST=localhost | |
BUCKET=sessiondb_dep | |
COLLECTION=_default | |
SCOPE=_default | |
USERNAME=sessiondb_dep | |
PASSWORD=sessiondb_dep | |
API_KEY=<YOUR_API_KEY> | |
API_SECRET=<YOUR_API_SECRET> | |
SENDER_MAIL=<YOUR_SENDER_MAIL> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
prometheus: | |
image: prom/prometheus:v2.26.0 | |
volumes: | |
- ./prometheus.yml:/etc/prometheus/prometheus.yml | |
ports: | |
- "9090:9090" | |
grafana: | |
image: grafana/grafana:7.5.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: 1 | |
datasources: | |
- name: Prometheus | |
type: prometheus | |
access: proxy | |
isDefault: true | |
url: http://prometheus:9090/ |
NewerOlder