본문 바로가기
공부하는 하스씨/Firebase

Firebase - Strorage - REST API

by 박하스. 2019. 9. 20.
728x90
반응형

어차피 그냥 개발자 문서지만. 다시 찾아서 보기 귀찮으므로 본문 복사. 

https://firebase.google.com/docs/storage/gcp-integration?authuser=0

 

Google Cloud Platform과 통합  |  Firebase

Firebase용 Cloud Storage는 Google Cloud Platform과 긴밀하게 통합되어 있습니다. Cloud Storage용 Firebase SDK는 Google Cloud Storage 버킷에 직접 파일을 저장하므로 앱의 성장에 따라 App Engine, Cloud 함수와 같은 관리형 컴퓨팅 또는 Cloud Vision, Google 번역과 같은 기계 학습 API 등의 기타 Cloud 서비스를 손쉽게 통합할 수 있습니다. Cloud St

firebase.google.com

 

REST API

클라이언트 라이브러리가 없는 언어를 사용하거나, 클라이언트 라이브러리가 제공하지 않는 기능을 수행해야 하거나, 특정한 HTTP 클라이언트를 사용하고 싶은 경우 Cloud Storage가 제공하는 JSON  XML API를 사용할 수 있습니다.

gsutil

gsutil은 Cloud Storage에 직접 액세스할 수 있는 명령줄 도구입니다. gsutil로 다음을 비롯하여 광범위한 버킷 및 객체 관리 작업을 수행할 수 있습니다.

  • 객체 업로드, 다운로드, 삭제
  • 버킷 및 객체 나열
  • 객체 이동, 복사 및 이름 바꾸기
  • 객체 및 버킷 ACL 수정

gsutil은 디렉토리 간 파일 이동, 특정 위치 아래의 모든 파일 삭제와 같은 고급 기능도 지원합니다.

다음과 같이 한 참조의 모든 파일을 다른 참조로 손쉽게 이동할 수 있습니다.

gsutil mv gs://bucket/old/reference gs://bucket/new/reference

 

참조 위치 아래의 모든 파일을 일괄 삭제하는 방법도 매우 간단합니다.

# Delete all files under a path
gsutil rm
-r gs://bucket/reference/to/delete

# Delete all the files in a bucket but not the bucket
gsutil rm
-r gs://bucket/**



# Delete all the files AND the bucket
# Removing the default bucket will break the Firebase SDKs for Cloud Storage and is strongly discouraged
gsutil rm
-r gs://bucket

 

 

 

 

아아 이게 말이야 방구야...

728x90
반응형